You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently also bumped into a schema that is not parsable by schemars 0.8, but it works with 1.0. Don't know the cause yet, but this also made me wonder why typify has not upgraded.
In #737@ahl commented a little on this, moving in another direction, but that seems a lot of work compared to upgrading?
Is there something else blocking this? Like has schemars removed information needed by typify to work? Again, I've just started to investigate, so I'm still very ignorant. But I would like to have a crate like typify to 'just work', these are the gems we need for Rust to mature.
Very good to hear, what is the general direction of your fix?
1. migrating to schemars 1.0
2. 'copy paste bad design and maintain it' as [@dzmitry-lahoda](https://github.com/dzmitry-lahoda) put it
3. a major rework as suggested by [@ahl](https://github.com/ahl)
I'm curious about the interest here. Typify has--effectively--two uses of schemars:
It uses schemars for (not very accurate) parsing and internal representation of JSON Schema
It emits code that derives schemars::JsonSchema for types
For 1, there's no migration as those structures have been removed. We will roll our own IR. For 2, I'd just like to make sure we can support consumers who depend on schemars 1.0 or 0.8 (or maybe both).
Are folks interested in this because they want generated code to implement schemars::JsonSchema from version 1.0?
@ahl The interest on my part is mostly because of point 1, generating Rust types from an existing json-schema that allows for parsing and interacting with data structures without resorting to 'magic' strings etc. The generated builders additionally allow for better written tests as well. Using a crate like jsonschema supports typify very well by allowing for independent schema-validation of source or generated structures.
As for upgrading schemars, that was because typify was full circle brilliant because you can do schema -> Rust -> schema. But as schemars has essentially removed the internal representation information one needs to do schema -> Rust, I don't really trust this to generate the same result Rust -> schema. Ergo, I'm not looking for point 2 specifically.
I'm curious about the interest here. Typify has--effectively--two uses of schemars:
1. It uses schemars for (not very accurate) parsing and internal representation of JSON Schema
2. It emits code that derives `schemars::JsonSchema` for types
For 1, there's no migration as those structures have been removed. We will roll our own IR. For 2, I'd just like to make sure we can support consumers who depend on schemars 1.0 or 0.8 (or maybe both).
Are folks interested in this because they want generated code to implement schemars::JsonSchema from version 1.0?
This will have to be a breaking change. Users can migrate or stay to a previous version if they use 0.8 for open api 3.0 for users, for 3.1 won't have a choice but sept to migrate.
Activity
eveeifyeve commentedon Sep 13, 2025
It's a lot of complex they removed metadata and all of the schemars::schema options.
dzmitry-lahoda commentedon Sep 13, 2025
#737 seems have some basics needed for upgrade
fulmen3000 commentedon Sep 13, 2025
I recently also bumped into a schema that is not parsable by schemars 0.8, but it works with 1.0. Don't know the cause yet, but this also made me wonder why typify has not upgraded.
In #737 @ahl commented a little on this, moving in another direction, but that seems a lot of work compared to upgrading?
Is there something else blocking this? Like has schemars removed information needed by typify to work? Again, I've just started to investigate, so I'm still very ignorant. But I would like to have a crate like typify to 'just work', these are the gems we need for Rust to mature.
eveeifyeve commentedon Sep 13, 2025
There is a blocker with schemars because a lot was changed in 0.8 to 1.0 with the removal of type objects replaced by the Schema Struct.
eveeifyeve commentedon Sep 13, 2025
I am working hard on fixing this but however it's a huge migration.
fulmen3000 commentedon Sep 13, 2025
Very good to hear, what is the general direction of your fix?
eveeifyeve commentedon Sep 13, 2025
balisujohn commentedon Sep 13, 2025
@eveeifyeve Interested in helping accelerate this. If some part of this is neatly separable and can be done in parallel, let me know.
ahl commentedon Sep 15, 2025
I'm curious about the interest here. Typify has--effectively--two uses of schemars:
schemars::JsonSchemafor typesFor 1, there's no migration as those structures have been removed. We will roll our own IR. For 2, I'd just like to make sure we can support consumers who depend on schemars 1.0 or 0.8 (or maybe both).
Are folks interested in this because they want generated code to implement schemars::JsonSchema from version 1.0?
fulmen3000 commentedon Sep 15, 2025
@ahl The interest on my part is mostly because of point 1, generating Rust types from an existing json-schema that allows for parsing and interacting with data structures without resorting to 'magic' strings etc. The generated builders additionally allow for better written tests as well. Using a crate like jsonschema supports typify very well by allowing for independent schema-validation of source or generated structures.
As for upgrading schemars, that was because typify was full circle brilliant because you can do schema -> Rust -> schema. But as schemars has essentially removed the internal representation information one needs to do schema -> Rust, I don't really trust this to generate the same result Rust -> schema. Ergo, I'm not looking for point 2 specifically.
h7kanna commentedon Sep 16, 2025
I had structs implement the Schema (option 2), strictly not needed!
eveeifyeve commentedon Sep 17, 2025
This will have to be a breaking change. Users can migrate or stay to a previous version if they use 0.8 for open api 3.0 for users, for 3.1 won't have a choice but sept to migrate.
build(rust)!: opentelemetry 0.33, schemars held at 0.8 for typify (#170)