Skip to content

Validation of a property with patternProperties is wrongly failing #4518

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

Open
4 tasks done
lucas-jc opened this issue Mar 6, 2025 · 2 comments
Open
4 tasks done

Validation of a property with patternProperties is wrongly failing #4518

lucas-jc opened this issue Mar 6, 2025 · 2 comments

Comments

@lucas-jc
Copy link

lucas-jc commented Mar 6, 2025

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

The validation of the property with pattern is failing, even when it is empty.

Expected Behavior

The validation should pass in this scenario.

Steps To Reproduce

  1. Open this shared link of RJSF Playground example.
  2. Click in the form submit button, the validation is ok.
  3. Fill annotation1 field with any text and then clean it.
  4. Click again in the submit button and now the validation fails, even with the annotation object empty, the same state it was in step 2.

Environment

React Json Schema Playground environment - https://rjsf-team.github.io/react-jsonschema-form

Anything else?

Image

@lucas-jc lucas-jc added bug needs triage Initial label given, to be assigned correct labels and assigned labels Mar 6, 2025
@nickgros
Copy link
Contributor

@lucas-jc I can reproduce the issue. At first it does not look like an RJSF bug but it definitely is because the error only occurs after modifying the data in the field, even when the formData looks the same in the playground. I wonder if there's some stale cache issue. We might need some help debugging this one with the limited time we maintainers have.

@nickgros nickgros added validation and removed needs triage Initial label given, to be assigned correct labels and assigned labels Mar 21, 2025
@lucas-jc
Copy link
Author

lucas-jc commented Mar 26, 2025

Hi @nickgros , thank you for the feedback. I found the root cause after debugging the Form component, it is receiving "undefined" in formData when I type something, remove and submit. Do you have any suggestion to resolve it?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants