Skip to content
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

fix: #3260 by properly mapping missing required fields #3309

Merged
merged 1 commit into from Dec 22, 2022

Conversation

heath-freenome
Copy link
Member

@heath-freenome heath-freenome commented Dec 22, 2022

Reasons for making this change

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

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

Before:
Screen Shot 2022-12-22 at 11 38 24 AM

After:
Screen Shot 2022-12-22 at 11 38 12 AM

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
@nickgros nickgros changed the title fix: 3260 by properly mapping missing required fields fix: #3260 by properly mapping missing required fields Dec 22, 2022
@heath-freenome heath-freenome merged commit 2a8384b into rjsf-team:main Dec 22, 2022
@heath-freenome heath-freenome deleted the fix-3260 branch December 22, 2022 20:53
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
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
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this pull request Jun 8, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ajv8 does not properly show errors inline under certain circumstances when ajv6 does
2 participants