"should be equal to one of the allowed values" for async field
See original GitHub issueDescription
I created an Async Select widget out of react-select, this select widget can download/update options based on user input.
Steps to Reproduce
[Default enum] -> jsonschema -> Display Select with custom widget -> User type words to search -> The Select update the options -> User choose a new option -> “should be equal to one of the allowed values”
Expected behavior
The new options are allowed.
Please let me know:
- How can I remove this validate
- Or, how can I added the new options downloaded from async function and make them allowed at the widget level (field).
Actual behavior
Error: should be equal to one of the allowed values
Version
“react-jsonschema-form”: “^1.0.0”,
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
"should be equal to one of the allowed values" for async field
I created an Async Select widget out of react-select, this select widget can download/update options based on user input.
Read more >async function - JavaScript - MDN Web Docs - Mozilla
An async function will return a different reference, whereas Promise.resolve returns the same reference if the given value is a promise. It can ......
Read more >Input value validators - Async-graphql Book
Async -graphql has some common validators built-in, you can use them on the parameters of object fields or on the fields of InputObject...
Read more >Async Validator with Value Changes - angular - Stack Overflow
You said in your question the field should be considered valid if the entered value matches a specific item. Please rephrase if I...
Read more >2.0.0 | AsyncAPI Initiative for event-driven APIs
YAML, being a superset of JSON, can be used as well to represent a A2S (AsyncAPI Specification) file. For example, if a field...
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

After many tests, I think I found the solution:
transformErrorsto remove errors ofshould be equal to one of the allowed valuestransformErrorsto form:That is it. It will ignore all validation.
I think if the schema can allow arbitrary values, then
enumisn’t really right for this field. Modifying the schema is I guess one option, but maybe you should just override that one widget using uiSchema and provide a select widget that has an initial set of values instead of usingenumto provide those values.