-
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
Enum validation fails for numbers #1098
Comments
The issue here is that the default |
You can work around this by setting the const SCHEMA = {
type: "object",
properties: {
count: {
enum: [1, 2, 3],
type: "number"
}
}
}; |
I've opened a PR to infer the type from the |
Connects to #1098 Change-type: minor Signed-off-by: Lucian <lucian.buzzo@gmail.com>
…team#1100) Connects to rjsf-team#1098 Change-type: minor Signed-off-by: Lucian <lucian.buzzo@gmail.com>
As #1100 was merged and released in v1.0.7, I'm closing this. Please let me know if the problem persists. |
* Infer type from enum if a type is not provided to SelectWidget (#1100) Connects to #1098 Change-type: minor Signed-off-by: Lucian <lucian.buzzo@gmail.com> * No more useless div on schema field not additional * Fix tests (remove useles html) - Revert some test added by https://github.com/mozilla-services/react-jsonschema-form/pull/1123/files - use new css class for form-additional insted layout css class for test selection * Don't use WrapIfAdditonal Component to hav a clerer diff, but adding code duplicate * Use a WrapIfAdditional Component to have a cleanner code / diff * Fix tests * Ignore vscode Ide folder * Remove useless parentProps * Fix old test selector for form additional
…team#1158) * Infer type from enum if a type is not provided to SelectWidget (rjsf-team#1100) Connects to rjsf-team#1098 Change-type: minor Signed-off-by: Lucian <lucian.buzzo@gmail.com> * No more useless div on schema field not additional * Fix tests (remove useles html) - Revert some test added by https://github.com/mozilla-services/react-jsonschema-form/pull/1123/files - use new css class for form-additional insted layout css class for test selection * Don't use WrapIfAdditonal Component to hav a clerer diff, but adding code duplicate * Use a WrapIfAdditional Component to have a cleanner code / diff * Fix tests * Ignore vscode Ide folder * Remove useless parentProps * Fix old test selector for form additional
Prerequisites
Description
react-jsonschema-form fails validation when the schema field has
enum
validation and a number is selected.Steps to Reproduce
Expected behavior
The demo application should display the following content JSON in the pre tag:
Actual behavior
Validation failed, and the following error message was produced.
Version
1.0.6
The text was updated successfully, but these errors were encountered: