-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add schemaPath to transformAjvErrors #838
Comments
Hi @dosborne , I do agree that the schema path should be added to the transformErrors function, but a work around for this issue that worked for me could be the following: 1.- Customize the 2.-Create
3.-Create a custom |
Prerequisites
Description
I'm using rjsf in a project and require custom messages that are part of the schema. For example:
Here myCustomErrors defines custom error messages. So when running rjsf validation I provide a transformErrors function, which is called with the error messages generated by rjsf. I need a way to map the error into the schema so that I can extract the proper error message. Looking at the source this should be as easy as updating validate.js to add the schemaPath to the error message structure.
Something like the following:
Steps to Reproduce
Here's a sample JSFiddle demonstrating that validation doesn't have the schemaPath.
Expected behavior
I need to have access to the schemaPath
Actual behavior
I don't have access to the schemaPath
Version
1.0.1
The text was updated successfully, but these errors were encountered: