Skip to content

Conversation

halvko
Copy link

@halvko halvko commented Oct 4, 2025

Tried doing a project with dropshot and was surprised it was on an old version of schemars. I thought I would give back by upgrading. After spending some time updating schema constructions and checks to the new format, I encountered that we use a SchemaSettings setting which is no longer viable in the new version of schemars. I hope you are willing to add a comment like the one in this PR to upstream to avoid another person going down the same rabbit hole.

Copy link
Collaborator

@davepacheco davepacheco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for trying to help and sorry it didn't pan out.

Comment on lines +90 to +93
# While a 1.0 version is out, there is no way to generate an OpenAPIv3 spec without adding nullable
# for all of the fields - see https://docs.rs/schemars/1.0.4/src/schemars/generate.rs.html#126 for
# how SchemaSettings::option_nullable is handled now. As the other transformers are not public
# creating our own version would take quite a bit of source code copy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# While a 1.0 version is out, there is no way to generate an OpenAPIv3 spec without adding nullable
# for all of the fields - see https://docs.rs/schemars/1.0.4/src/schemars/generate.rs.html#126 for
# how SchemaSettings::option_nullable is handled now. As the other transformers are not public
# creating our own version would take quite a bit of source code copy
# While newer versions of schemars are available, they are not trivial for us to update to.
# See oxidecomputer/dropshot#1375 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants