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

OneOf playground sample with maxLength generating wrong validation message #4427

Open
4 tasks done
DharamveerYadav opened this issue Dec 19, 2024 · 1 comment
Open
4 tasks done
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned

Comments

@DharamveerYadav
Copy link

DharamveerYadav commented Dec 19, 2024

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

Using sample JSON for oneOf given on RJSF playground,

{
"type": "object",
"oneOf": [
{
"properties": {
"lorem": {
"type": "string",
"maxLength": 50
}
},
"required": [
"lorem"
]
},
{
"properties": {
"ipsum": {
"type": "string",
"maxLength": 50
}
},
"required": [
"ipsum"
]
}
]
}

I have just inserted maxLength attribute to both of the properties to validate the max length.

validation message thrown is:
image

Expected Behavior

It should throw only : "must NOT have more than 50 characters".

Should not throw : "must match exactly one schema in oneOf".

Steps To Reproduce

try above mentioned JSON schema on rjsf playground and validate the form

Environment

- OS:
- Node:
- npm:

Anything else?

(https://rjsf-team.github.io/react-jsonschema-form/)

@DharamveerYadav DharamveerYadav added bug needs triage Initial label given, to be assigned correct labels and assigned labels Dec 19, 2024
@DharamveerYadav
Copy link
Author

Any update on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned
Projects
None yet
Development

No branches or pull requests

1 participant