-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
enumNames is not in JSON Schema spec #532
Comments
Well let see how it turns out, because the usability of the current implementation is good enough. Do you think react-jsonschema-form should implement all of this specs? It sounds terrible to me. |
Not sure what you mean by "all this specs", but I'd say it should rather implement something from the spec than something not from the spec (as This description is indeed more verbose but it has the advantage of coupling tight the value and the title rather than relying on the order of two arrays. Another advantage is that is make use of an existing construct Unfortunately (#52), |
I'm surprised the spec evolves in a non-backward-compatible manner. Or would that mean we should support all draft versions of it? So why I'm all in for having full support of latest spec draft, this one involves a bunch of work so help is badly needed. Also, as v4 is widely used it's no question we should keep supporting it anyway. Meanwhile, any help would be greatly appreciated. |
On this particular point, it did not. |
I just looked up some stuff related to |
Oops, I see those links are already in @dlax's summary at the top, sorry for the noise. |
I also need this support ,because I use "JSON.NET" as my server site jsonschema library. |
@eddyzhang1986, it has been merged in 3df0ab7 :) |
@fbessou thank you ,that feature is very cool |
Closing as PR #581 is merged. |
Prerequisites
Description
react-jsonschema-form has implemented support for labels in enum fields through the
enumNames
keyword following a proposal which then turned into issue json-schema-org/json-schema-spec#57 in which the proposal got refused. So theenumNames
keyword does not appear and will probably not appear in JSON Schema specification format and react-jsonschema-form thus deviates from it.From json-schema-org/json-schema-spec#57, the recommended way to handle labels in enum is to use a
oneOf
with a set of schemas. So following the example from documentation, it would be (in draft-v5):In draft-v6, a
const
keyword got added (see json-schema-org/json-schema-spec#139), so the example above could be simplified as:Version
0.45
The text was updated successfully, but these errors were encountered: