Modify JSON Validation for Optgroup support
See original GitHub issueHello, I’ve successfully created the widget to support optgroup select (i.e. categories inside a select). I’m now seeking help for the validation.
In order to generate the categories I give a dict instead of a list to my “enum” field. How can I modify the JSON validation to avoid the error .enum should be array
Here is the codepen of my implementation:
https://codepen.io/enola-guy/pen/ZEQOVEN
If you can explain me the steps missing, I would gladly open a PR in order to make this feature in the main branch 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
angular - angular6-json-schema-form issue with multi-select ...
I have created a MaterialSelectComponent file which is a copy of the same file from 'angular6-json-schema-form' and then added the custom ...
Read more >lamjar - JSON Formatter
JSON Formatter and JSON Validator help to auto format JSON and validate your JSON text. It also provides a tree view that helps...
Read more >HTML optgroup tag - W3Schools
The <optgroup> tag is used to group related options in a <select> element (drop-down list). If you have a long list of options,...
Read more >AWS::RDS::OptionGroup - AWS CloudFormation
The AWS::RDS::OptionGroup resource creates or updates an option group, to enable and configure features that are specific to a particular DB engine.
Read more >Re: Dependencies between two "enums" - Google Groups
And I am still convinced that a mechanism like I proposed would also help jsonary a lot. Also I think the usefulness of...
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
@Enola-guy thanks for your custom widget! I don’t think we can merge this into the main library, though, until we have a JSON Schema-compliant approach (and in JSON Schema,
enum
must be an array, not a dict). Can you think of a JSON-schema-compliant way of using optgroups? For example, this might involve customizing the optgroups in uiSchema using something like this:This is just an idea – let me know if you have any other thoughts / ways of doing this.
@Enola-guy Can you please share your working code here?