oxidecomputer / oxidecomputer/typify
Types not generated for GLTF 2.0 schema (expected a '/' in $ref)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 898
- Forks
- 114
- Avg merge
- 4h 18m
- Merged PRs (30d)
- 14
Description
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:
- Place this (somewhat) minimal JSON Schema in a folder where
import_types!can find it - Use the
import_types!macro withinmain.rsto attempt to generate types for the schema - 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the panic using the linked minimal GLTF schema in a main.rs file with the import_types! macro, then trace the macro's handling of the reported $ref value. Done means the schema and the unmodified or bundled GLTF schemas generate Rust types without panicking; add or run a regression check if the repository provides one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, rust
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100