-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
core
Version
5.19.4
Current Behavior
Given the following ErrorSchema
const errorSchema = {
"array": [
{
"field": {
"__errors": [
"is required"
]
}
}
]
}
import { toErrorList } from '@rjsf/utils';
toErrorList(errorSchema); //Returns empty array
Returns empty array
Expected Behavior
Given the following ErrorSchema
const errorSchema = {
"array": [
{
"field": {
"__errors": [
"is required"
]
}
}
]
}
import { toErrorList } from '@rjsf/utils';
toErrorList(errorSchema); //Returns empty array
should return
[{
"property": ".array.0.field",
"message": "is required",
"stack": ".array.0.field is required"
}]
Steps To Reproduce
- Pass ErrorSchema to form instance via extra errors with array errors
- ErrorListTemplate not displaying array errors
Environment
Playground
Anything else?
My understanding is that it's treating arrays as the errors and as such is ignoring the array structure.
It's only noticeable when you define the errors in the extra errors. The errors appear correctly on the form field but are missing in the error field template