-
Notifications
You must be signed in to change notification settings - Fork 639
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
Include the supplied value in the validation errorHash that is passed to createValidationError #1718
Labels
Comments
Just bumping this. Happy to implement a PR, but don't want to do so if it's unlikely to be accepted! |
I'd be happy to review a PR for this! |
1 task
Here it is 😉 |
cesumilo
added a commit
to inarix/objection.js
that referenced
this issue
Mar 1, 2024
lehni
pushed a commit
that referenced
this issue
Mar 3, 2024
Thanks @cesumilo ! |
lehni
pushed a commit
that referenced
this issue
Mar 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've found myself wanting to create a custom
ValidationError
that includes the value that was validated alongside the error message. For example, if I have the following JSON Schema:And I try to validate the following:
I'd like the exception to contain the following information:
The
ajv
library will add a 'data' property to its error object if theverbose
option is set. The implementation in Objection currently takes themessage
,keyword
andparams
keys, so even if theverbose
option is set via a custom Ajv instance, thedata
property won't be propagated to thecreateValidationError
static method.Would you be open to supporting this functionality, either by default or as an opt-in config flag?
Alternatively if there is another way I can achieve this goal, please let me know.
Thanks again for a great library 😄
The text was updated successfully, but these errors were encountered: