oxidecomputer / oxidecomputer/typify

Panic: Not yet implemented: unhandled not schema Object

Open
#954 8 comments 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

Running typify on the BloodHound OpenGraph schemas for edge and node panics.

> cargo typify edge.json                          
The application panicked (crashed).
Message:  not yet implemented: unhandled not schema Object(
    SchemaObject {
        metadata: None,
        instance_type: Some(
            Single(
                Object,
            ),
        ),
        format: None,
        enum_values: None,
        const_value: None,
        subschemas: None,
        number: None,
        string: None,
        array: None,
        object: None,
        reference: None,
        extensions: {},
    },
)
Location: /home/notroot/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/typify-impl-0.5.0/src/convert.rs:1751

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The line where it crashes:
https://github.com/oxidecomputer/typify/blob/3661e265f63ab6f776df15d26818f8e55b4a1626/typify-impl/src/convert.rs#L1751

Which is the catch-all match arm in convert_not
https://github.com/oxidecomputer/typify/blob/3661e265f63ab6f776df15d26818f8e55b4a1626/typify-impl/src/convert.rs#L1608-L1615

Info

JSON Schema

{
    "title": "Generic Ingest Edge",
    "description": "Defines an edge between two nodes in a generic graph ingestion system. Each edge specifies a start and end node using either a unique identifier (id) or a name-based lookup. A kind is required to indicate the relationship type. Optional properties may include custom attributes. You may optionally constrain the start or end node to a specific kind using the kind field inside each reference.",
    "type": "object",
    "properties": {
        "start": {
            "type": "object",
            "properties": {
                "match_by": {
                    "type": "string",
                    "enum": ["id", "name"],
                    "default": "id",
                    "description": "Whether to match the start node by its unique object ID or by its name property."
                },
                "value": {
                    "type": "string",
                    "description": "The value used for matching — either an object ID or a name, depending on match_by."
                },
                "kind": {
                    "type": "string",
                    "description": "Optional kind filter; the referenced node must have this kind."
                }
            },
            "required": ["value"]
        },
        "end": {
            "type": "object",
            "properties": {
                "match_by": {
                    "type": "string",
                    "enum": ["id", "name"],
                    "default": "id",
                    "description": "Whether to match the start node by its unique object ID or by its name property."
                },
                "value": {
                    "type": "string",
                    "description": "The value used for matching — either an object ID or a name, depending on match_by."
                },
                "kind": {
                    "type": "string",
                    "description": "Optional kind filter; the referenced node must have this kind."
                }
            },
            "required": ["value"]
        },
        "kind": {
            "type": "string",
            "description": "Edge kind name must contain only alphanumeric characters and underscores.",
            "pattern": "^[A-Za-z0-9_]+$"
        },
        "properties": {
            "type": ["object", "null"],
            "description": "A key-value map of edge attributes. Values must not be objects. If a value is an array, it must contain only primitive types (e.g., strings, numbers, booleans) and must be homogeneous (all items must be of the same type).",
            "additionalProperties": {
                "type": ["string", "number", "boolean", "array"],
                "items": {
                    "not": {
                        "type": "object"
                    }
                }
            }
        }
    },
    "required": ["start", "end", "kind"],
    "examples": [
        {
            "start": {
                "match_by": "id",
                "value": "user-1234"
            },
            "end": {
                "match_by": "id",
                "value": "server-5678"
            },
            "kind": "has_session",
            "properties": {
                "timestamp": "2025-04-16T12:00:00Z",
                "duration_minutes": 45
            }
        },
        {
            "start": {
                "match_by": "name",
                "value": "alice",
                "kind": "User"
            },
            "end": {
                "match_by": "name",
                "value": "file-server-1",
                "kind": "Server"
            },
            "kind": "accessed_resource",
            "properties": {
                "via": "SMB",
                "sensitive": true
            }
        },
        {
            "start": {
                "value": "admin-1"
            },
            "end": {
                "value": "domain-controller-9"
            },
            "kind": "admin_to",
            "properties": {
                "reason": "elevated_permissions",
                "confirmed": false
            }
        },
        {
            "start": {
                "match_by": "name",
                "value": "Printer-007"
            },
            "end": {
                "match_by": "id",
                "value": "network-42"
            },
            "kind": "connected_to",
            "properties": null
        }
    ]
}

Backtrace

The application panicked (crashed).
Message:  not yet implemented: unhandled not schema Object(
    SchemaObject {
        metadata: None,
        instance_type: Some(
            Single(
                Object,
            ),
        ),
        format: None,
        enum_values: None,
        const_value: None,
        subschemas: None,
        number: None,
        string: None,
        array: None,
        object: None,
        reference: None,
        extensions: {},
    },
)
Location: /home/notroot/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/typify-impl-0.5.0/src/convert.rs:1751

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 7 frames hidden ⋮                               
   8: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_not::hfb39fec643f2fb80
      at <unknown source file>:<unknown line>
   9: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema_object::hd6be2b1b902499a7
      at <unknown source file>:<unknown line>
  10: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema::h02cdab117a63e14e
      at <unknown source file>:<unknown line>
  11: typify_impl::TypeSpace::id_for_schema::hfa9c03d635fb62b6
      at <unknown source file>:<unknown line>
  12: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_array::h9927dda009e79775
      at <unknown source file>:<unknown line>
  13: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema_object::hd6be2b1b902499a7
      at <unknown source file>:<unknown line>
  14: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema::h02cdab117a63e14e
      at <unknown source file>:<unknown line>
  15: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_all_of::h8245ea0cae58de93
      at <unknown source file>:<unknown line>
  16: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema_object::hd6be2b1b902499a7
      at <unknown source file>:<unknown line>
  17: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema::h02cdab117a63e14e
      at <unknown source file>:<unknown line>
  18: typify_impl::enums::<impl typify_impl::TypeSpace>::external_variant::h24d374d0dd109ecc
      at <unknown source file>:<unknown line>
  19: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold::hec3f5c2a901a1635
      at <unknown source file>:<unknown line>
  20: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::hd7d5a5eac2dfe3af
      at <unknown source file>:<unknown line>
  21: core::iter::adapters::try_process::h0204a60ca93bfa33
      at <unknown source file>:<unknown line>
  22: typify_impl::enums::<impl typify_impl::TypeSpace>::untagged_enum::he7bf6a1260abd32b
      at <unknown source file>:<unknown line>
  23: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema_object::hd6be2b1b902499a7
      at <unknown source file>:<unknown line>
  24: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema::h02cdab117a63e14e
      at <unknown source file>:<unknown line>
  25: typify_impl::TypeSpace::id_for_schema::hfa9c03d635fb62b6
      at <unknown source file>:<unknown line>
  26: typify_impl::structs::<impl typify_impl::TypeSpace>::make_map::hfe9b49a911eb8b56
      at <unknown source file>:<unknown line>
  27: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_object::he5d077a1280ed520
      at <unknown source file>:<unknown line>
  28: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema_object::hd6be2b1b902499a7
      at <unknown source file>:<unknown line>
  29: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema::h02cdab117a63e14e
      at <unknown source file>:<unknown line>
  30: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema_object::hd6be2b1b902499a7
      at <unknown source file>:<unknown line>
  31: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema::h02cdab117a63e14e
      at <unknown source file>:<unknown line>
  32: typify_impl::TypeSpace::id_for_schema::hfa9c03d635fb62b6
      at <unknown source file>:<unknown line>
  33: typify_impl::structs::<impl typify_impl::TypeSpace>::struct_property::ha48c3d71d45991cc
      at <unknown source file>:<unknown line>
  34: core::iter::adapters::filter_map::filter_map_try_fold::{{closure}}::h3171f138758aeaf1
      at <unknown source file>:<unknown line>
  35: <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::try_fold::hca3d638324f03021
      at <unknown source file>:<unknown line>
  36: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::h343d55ca913780d2
      at <unknown source file>:<unknown line>
  37: core::iter::adapters::try_process::h50d064b291b38b37
      at <unknown source file>:<unknown line>
  38: typify_impl::structs::<impl typify_impl::TypeSpace>::struct_members::h112dce235bd36993
      at <unknown source file>:<unknown line>
  39: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_object::he5d077a1280ed520
      at <unknown source file>:<unknown line>
  40: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema_object::hd6be2b1b902499a7
      at <unknown source file>:<unknown line>
  41: typify_impl::convert::<impl typify_impl::TypeSpace>::convert_schema::h02cdab117a63e14e
      at <unknown source file>:<unknown line>
  42: typify_impl::TypeSpace::convert_ref_type::h76939c0f40790204
      at <unknown source file>:<unknown line>
  43: typify_impl::TypeSpace::add_root_schema::h1d074e78b5fa7f01
      at <unknown source file>:<unknown line>
  44: cargo_typify::convert::hdbbf4f622a5d9466
      at <unknown source file>:<unknown line>
  45: cargo_typify::main::h0fa2a6bf12cf53cb
      at <unknown source file>:<unknown line>
  46: std::sys::backtrace::__rust_begin_short_backtrace::hb1410cc4bb68c11f
      at <unknown source file>:<unknown line>
  47: std::rt::lang_start::{{closure}}::h065001449cded4f6
      at <unknown source file>:<unknown line>
  48: std::rt::lang_start_internal::h1536f6da427acac8
      at <unknown source file>:<unknown line>
  49: main<unknown>
      at <unknown source file>:<unknown line>
  50: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  51: __libc_start_main_alias_1<unknown>
      at <unknown source file>:<unknown line>
  52: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

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

Reproduce the failure with cargo typify edge.json using the supplied schema, then inspect typify-impl/src/convert.rs around convert_not and its catch-all arm. Trace the not object schema reached through properties.additionalProperties.items and verify that processing edge.json and node.json completes without a panic.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.