-
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
ajv8 does not properly show errors inline under certain circumstances when ajv6 does #3260
Comments
@heath-freenome any insights on this? Thank you |
Hmmm, this may be a bug related to subtle differences between ajv6 and ajv8 and how we are using them. Do you have a reproducible test case? |
Here it is inside of the playground |
It looks like the Ajv raw errors for missing required properties doesn't point to the property, but to the object containing the |
Hopefully this is a fix in |
fix rjsf-team#3260 The required field errors weren't mapped to the fields they were associated to in the `ErrorSchema` This mapping issue was fixed as follows: - In `@rjsf/core`, updated the `Form` and `validate` tests to fix the mapping issue in the test data for the required fields - In `@rjsf/validator-ajv6`, added additional tests for testing top-level and nested required field errors to verify things worked with ajv6 - In `@rjsf/validator-ajv8`, fixed the `transformRJSFValidationErrors()` function in the validator to look for `missingProperty: 'field'` information in the `params` property using that to properly map the error `property` - Replicated the tests made in `@rjsf/validator-ajv6` to this package to verify that the fix is working properly - Updated the `CHANGELOG.md` accordingly
fix #3260 The required field errors weren't mapped to the fields they were associated to in the `ErrorSchema` This mapping issue was fixed as follows: - In `@rjsf/core`, updated the `Form` and `validate` tests to fix the mapping issue in the test data for the required fields - In `@rjsf/validator-ajv6`, added additional tests for testing top-level and nested required field errors to verify things worked with ajv6 - In `@rjsf/validator-ajv8`, fixed the `transformRJSFValidationErrors()` function in the validator to look for `missingProperty: 'field'` information in the `params` property using that to properly map the error `property` - Replicated the tests made in `@rjsf/validator-ajv6` to this package to verify that the fix is working properly - Updated the `CHANGELOG.md` accordingly
fix rjsf-team#3260 The required field errors weren't mapped to the fields they were associated to in the `ErrorSchema` This mapping issue was fixed as follows: - In `@rjsf/core`, updated the `Form` and `validate` tests to fix the mapping issue in the test data for the required fields - In `@rjsf/validator-ajv6`, added additional tests for testing top-level and nested required field errors to verify things worked with ajv6 - In `@rjsf/validator-ajv8`, fixed the `transformRJSFValidationErrors()` function in the validator to look for `missingProperty: 'field'` information in the `params` property using that to properly map the error `property` - Replicated the tests made in `@rjsf/validator-ajv6` to this package to verify that the fix is working properly - Updated the `CHANGELOG.md` accordingly
fix rjsf-team#3260 The required field errors weren't mapped to the fields they were associated to in the `ErrorSchema` This mapping issue was fixed as follows: - In `@rjsf/core`, updated the `Form` and `validate` tests to fix the mapping issue in the test data for the required fields - In `@rjsf/validator-ajv6`, added additional tests for testing top-level and nested required field errors to verify things worked with ajv6 - In `@rjsf/validator-ajv8`, fixed the `transformRJSFValidationErrors()` function in the validator to look for `missingProperty: 'field'` information in the `params` property using that to properly map the error `property` - Replicated the tests made in `@rjsf/validator-ajv6` to this package to verify that the fix is working properly - Updated the `CHANGELOG.md` accordingly
Prerequisites
What theme are you using?
core
What is your question?
With
ajv6
the form errors (e.g. required properties) were displayed right under the form elements, which is very helpful especially when you use live validation.While
ajv8
validation marks form elements as invalid, error messages show up below the whole form. The longer the form, the higher chance of error messages being displayed outside users' view === bad user experience.I would like the error messages to be shown right below the form elements. Is there a way to achieve this?
What I noticed is that
rawErrors
is not being passed to the individual form element using v8.Help appreciated.
The text was updated successfully, but these errors were encountered: