-
Notifications
You must be signed in to change notification settings - Fork 218
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
export to json schema #181
Comments
Actually just found out about this other little project: https://pypi.python.org/pypi/genson which can be used to pass in dictionaries and get a schema out of them, but probably with a direct conversion from Voluptuous to json schema we could do something even more expressive.. |
Hey @AndreaCrotti : You mentioned |
Well @tusharmakkar08 I mean that maybe apart from all the various type declarations we could even have some conversion rules for some validators. |
@AndreaCrotti I personally feel that it might be a overkill since projects like Genson do a pretty good job at translating dictionaries to schemas. |
Ok no problem I'll close this then |
👍 |
As someone that tried to use Genson before for generating a schema for validating Zuul config files I would say that the tool has no practical use for complex schemas. If you are lucky you may get some valid results for very basic data models, very. Writing JSON schemas is a real PITA, it makes XML template transformation look like kindergarten stuff. If voluptuous would be able to create these schemas it would be great because there are already a big number of tools that can consume these schemas, and they validate not only JSON but also YAML and TOML as well. For example there is the http://schemastore.org/json/ project which is a directory of >200 schemas, which is supported by lots of tools/editor/linters. In my case I used VsCode YAML extension which enabled linting of all these files for free, because it can look for schemas on that store. In think that there are very good reasons for reopening this issue, as apparently we do have an emerging standard for schemas. |
I know this issue is ancient, but Genson is pretty much dead. I use this library now, it works great: voluptuous-serialize |
I was wondering if it was possible to convert a voluptuous schema definition into a json-schema
http://json-schema.org/documentation.html
I think the two formats are mostly overlapping in features, and at least all the basic things should be easy to convert, what do you think?
Thanks
The text was updated successfully, but these errors were encountered: