Skip to content

Types not generated for GLTF 2.0 schema (expected a '/' in $ref) #933

@nick-ls

Description

@nick-ls

Expected behavior

Types are correctly generated for this schema that passes jsonschema lint when the import_types! macro is used.

Actual behavior

The macro panics with this message: proc-macro panicked: expected a '/' in $ref: glTFProperty.schema.json.

Steps to reproduce:

  1. Place this (somewhat) minimal JSON Schema in a folder where import_types! can find it
  2. Use the import_types! macro within main.rs to attempt to generate types for the schema
  3. Observe that it panics with the message proc-macro panicked: expected a '/' in $ref: glTFProperty.schema.json

The same panic occurs with the unmodified JSON Schemas both when the root schema (glTF.schema.json) is passed to import_types! (with each schema in the directory being named the same as its $id), as well as when they are bundled and the bundled schema is passed. The panic also occurs after applying jsonschema lint's suggested fixes to the individual files (none of the fixes were for syntactic errors). For the final linted, fixed, and bundled file, the story is no different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions