oxidecomputer / oxidecomputer/typify

Panic in `all_mutually_exclusive` -> `resolve` (circleci config schema)

Open
#679 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

typify2
Dominant language
Rust
Stars
898
Forks
114
Avg merge
4h 18m
Merged PRs (30d)
14

Description

Hitting a panic in all_mutually_exclusive -> resolve util.rs:566

not yet implemented
stack backtrace:

   3: typify_impl::util::resolve
             at typify-impl\src\util.rs:566
   4: typify_impl::util::all_mutually_exclusive::closure$1

  20: typify_impl::util::all_mutually_exclusive
             at typify-impl\src\util.rs:51
  21: typify_impl::TypeSpace::convert_any_of
             at typify-impl\src\convert.rs:1397
  22: typify_impl::TypeSpace::convert_schema_object
             at typify-impl\src\convert.rs:498
  23: typify_impl::TypeSpace::convert_schema
             at typify-impl\src\convert.rs:37
  24: typify_impl::TypeSpace::convert_ref_type
             at typify-impl\src\lib.rs:594
  25: typify_impl::TypeSpace::add_ref_types_impl<alloc::vec::Vec<tuple$<enum2$<typify_impl::RefKey>,enum2$<schemars::schema::Schema> >,alloc::alloc::Global> >
             at typify-impl\src\lib.rs:565
  26: typify_impl::TypeSpace::add_root_schema

minimal repro:

{
  "definitions": {
    "a": {
      "description": "a"
    },
    "b": {
      "anyOf": [
        {
          "$ref": "#/definitions/a",
          "enum": ["A"]
        },
        {
          "$ref": "#/definitions/a",
          "enum": ["B"]
        }
      ]
    }
  }
}

extracted minimal repro from circleci json schema (src)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at typify-impl/src/util.rs:566 and trace all_mutually_exclusive through resolve, using the minimal JSON reproduction in the issue. Confirm the reproduction currently panics, then verify that the same schema is processed without the not-yet-implemented panic and that existing tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.