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

Generate sample json from schema #337

Open
kirsn opened this issue May 22, 2018 · 2 comments
Open

Generate sample json from schema #337

kirsn opened this issue May 22, 2018 · 2 comments

Comments

@kirsn
Copy link

kirsn commented May 22, 2018

I have used voluptuous to define a schema, and this has been really useful to validate the JSON content that my application deals with. Thanks for building voluptuous.

I would like to generate some sample JSON document, based on my schema. This is the inverse of the Schema.infer(). Any pointers on what I can try out, to make this happen - I can code this out, if needed.

@3dw1np
Copy link

3dw1np commented Mar 16, 2019

@kirsn
Copy link
Author

kirsn commented Mar 18, 2019

https://github.com/joehakimrahme/luscious

@3dw1np thanks for the link. Good to know about luscious. So the route to generate sample json from voluptuous schema is:

  1. voluptuous -> json-schema, using luscious
  2. then generate sample json, using suggestions from here: https://stackoverflow.com/q/21894873

In any case, the intention of doing all this was to generate hypothesis based tests using voluptuous schema definitions. So, am option like this would work too: https://github.com/Zac-HD/hypothesis-jsonschema

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

No branches or pull requests

2 participants