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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[馃摑 Docs]: Improve Enum documentation #521
Comments
Can I work on this one @benjagm |
Let's discuss what the improvement is in this issue before working on it. |
I guess telling the user where does enum live in overall schema using an example of enumerated values and then giving an example of using two different data types will be helpful. |
This is my point: where would you say that
|
Agreed @gregsdennis it can vary depending on different schemas |
It's fine as it is or we can just add an example for an array of enumerated values |
We shouldn't combine We tell people this all the time, and they still do it. But we shouldn't promote this practice. |
Completely agree with you @gregsdennis. |
We just received more feedback regarding improving the docs of Enum:
|
So what changes we should introduce in the documentation @benjagm ? |
I don't think that makes sense from a JSON Schema perspective. However, I think it might make sense if they're trying to build a form, and they want a field called |
Yeah agreed @gregsdennis |
Add what? We can't document any form gen stuff because every form generator does things differently. There's no standard. |
Comment: Is "enum" a keyword or a user-defined name? For example, would "color": ["red", "green", "blue"] work? This comment |
I don't understand how adding that improves the docs. |
I think the docs are actually quite clear that it's a keyword. The examples on the page use it as a keyword. JSON Schema is comprised of keywords. I'm not sure how else it can be interpreted. I don't know what the commenter means by "user-defined name" because there's no such thing in JSON Schema. There are custom keywords, but those are also keywords. The page STARTS with "The |
After going through this thread, I came up with a couple suggestions: 1. To further enrich the We can add
Also, I agree with @gregsdennis , using 2. In response to the comment received It seems like a common query beginners might have. The code above perfectly shows how to use @benjagm Let me know if this task can be Assigned to me. Thanks. |
is this free? |
@radhesh1 what needs doing is unclear. I don't think that anything needs to be done and this issue can be closed. If you see a way to make things more clear, please make a proposal here before creating a PR. |
What Docs changes are you proposing?
We received this feedback from the website and we think this is a great suggestion to improve our docs:
Page: /understanding-json-schema/reference/enum
Comment: It'd be nice to see enum defined in context - where does it live in an overall schema?
Code of Conduct
The text was updated successfully, but these errors were encountered: