Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat implemented support for schemars via a feature flag #483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akowi-sknobloch
Copy link

I've implemented the JsonSchema trait from the schemars crate.
I'm using serde + schemars in my project to generate a json schema so the users can easily create configs.
As i've switched a lot of my structs to use uom deriving the JsonSchema trait no longer worked.

I think supporting schemars would make a lot of sense for uom.
As uom already supports serde this addition would make building api's easier as you could simply generate your schema by deriving the trait.

My implementation of the Trait is pretty simple and covers the minimum.
I don't really like the schema name to be hard coded but i didn't know how i could set it automatically to eg. Length, Mass, etc.

Would be nice to get this feature merged :)
Happy for feedback and comments

@iliekturtles
Copy link
Owner

Thanks for the PR. I'll need to do some reading up on schemars. In the meantime I kicked off the automated tests to see if any immediate issues come up.

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