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
Setting Form prop extraErrors changes the structure of propagated error objects #2579
Comments
This also seems to happen if you use the
If I don't use This is on |
I have made a JSFiddle for this - https://jsfiddle.net/mdeazLy3/1/ There are 2 forms, one with a validate function and one without. The one with the function returns truncated |
Since this is old I opened #3262 - let me know if that wasn't the right thing to do |
@hughjdavey I'm treating #3262 as a documentation bug and will fix that one accordingly. I believe that the specific bug in this issue is already fixed in the v5 beta... Closing this accordingly |
A little late but we're finally in the process of migrating to rjsf@5 and i can confirm that this error has been fixed. Thx! |
Prerequisites
Description
If
extraErrors
is set as a<Form />
prop (it just needs to be an empty object) theerrors
array (in thetransformErrors
oronError
callback) doesn't provide the same error object data structure.With
extraErrors
being set:Without
extraErrors
being set:Is this behavior intentional? I couldn't find any hint in the docs.
Expected behavior
I would like to have internal errors being defined as detailed as possible no matter if some external
extraErrors
are brought into the error stack.Actual behavior
Internal errors are becoming less detailed if external
extraErrors
are set.See https://codesandbox.io/s/interesting-hertz-vo5ef?file=/src/App.js using
3.1.0
.If i use the JSFiddle template from above (which is using
1.8.1
as it seems, see https://unpkg.com/react-jsonschema-form/dist/react-jsonschema-form.js) the "error" doesn't occur. See https://jsfiddle.net/01qwf23d/4/.Version
3.1.0
The text was updated successfully, but these errors were encountered: