additionalProperties form - enum for key
See original GitHub issuePrerequisites
- I have read the documentation;
Description
Would it be possible to add a feature that would enable the user to set a given set of all possible keys of additionalProperties
?
At the moment, I validate the keys with propertyNames
which works, but it would be much cleaner for the user to have it set as an enum.
Expected behavior
additionalProperties
are rendered with a dropdown key selection if enum given.
Actual behavior
additionalProperties
have to options for key customizations and propertyNames
are ignored in the rendering phase (but used for validation).
Version
Latest.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Properties based on enum value in JSON Schema
I'm building a json schema definition which has a fixed set of controls that I've currently limited with an enum . However, not...
Read more >object — Understanding JSON Schema 2020-12 documentation
In JSON, the “keys” must always be strings. Each of these pairs is conventionally referred to as a “property”. Language-specific info: Python; Ruby....
Read more >Objects - react-jsonschema-form documentation
The additionalProperties keyword allows the user to add properties with arbitrary key names. Set this keyword equal to a schema object:
Read more >Edit form and Display form controls in Power Apps
Description; Key properties; Additional properties; More information; Accessibility guidelines. Display, edit, and create a record in a data ...
Read more >Dictionaries, Hashmaps, Associative Arrays - Swagger
OpenAPI lets you define dictionaries where the keys are strings. ... values can be of any type (aka free-form object), use additionalProperties: true...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not the OP, but as it happened was just googling for almost this same issue. My expected behavior was that, when there is a constraint on property names, the interface elements will use dropdowns for the keys to any additionalProperties.
For example, in the following schema, when you add another property to the array with a plus button, the values of the properties give you a dropdown to choose from “val1” and “val2”, but you just get a text field to write into without any hints about permitted values are. Instead, it should be a dropdown to choose from ‘foo’ or ‘bar.’
Great library, thanks for your work.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.