-
Notifications
You must be signed in to change notification settings - Fork 65
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
Enhancement: Parameter to use JSON values as default values. #63
Comments
That makes sense, though which you should choose as the default and why isn't clear. I suppose a This touches on a similar feature, which might actually be better: There are some challenges inherent in this though, since you may want an example not only at leaf nodes but even some parent nodes (tuples, for example). GenSON is also structured in such a way as to make it easy to add a new type of node, but not easy to add a new type of keyword across all nodes. I'll have to think on how to make that a little easier before adding a feature like this. |
Hi @wolverdude, any update on this? It would be nice to have this option and you exactly mentioned my requirement i.e., |
The |
@zbalkan Agree with you. Do you have any recommendations to get |
No. I needed to hack my way around to parse the generated result, then add examples as a separate field in the schema. Since schema is also a valid JSON, it is a relatively simple workaround. |
Cool. It seems like there's decent demand for this. It depends on keyword extensions, and having those would also make it easy to add a whole lot of other features (i.e. every JSON-Schema keyword not currently supported), but it's a tricky problem. I've been pondering it on and off today. At first, I thought keywords was a cross-cutting concern from The solution I'm settling on is to create a The nice thing about this is that it will modularize the existing code more and provide a way to extend for keywords specifically, independently of any To make this easier, I'll create a way to conveniently apply a Then I could add Does that sound like it'll work for you? |
If I understood correctly, the alternative When it comes to the I would suggest that finding a clear, simple and working way of adding |
Summary
JSON files used to generate already includes valid values. During conversion accepting them as the default values allows easy management later. This should be optional as it should be an intentional decision.
The text was updated successfully, but these errors were encountered: