You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However AJV doesn't support this feature unless the $data: true option is passed at initialization. See here in the AJV documentation for the attribute.
I saw in #633 that not all the options for the AJV instance are supported in the configuration, and you'd be adding support as they are requested.
I also confirmed for myself that the option isn't being passed.
Obviously its pretty simple to do this sort of check in the actual controller code, or another hook, so this issue isn't blocking.
However I think this usage of the JSON Schema to validate password confirmations is a pretty common use case, and warrants supporting in FoalTS.
If you'd like me to submit a PR, I'd be willing to, as it's a pretty trivial change. I'm just not sure how to best test a change like this to pass the PR approval process.
Thanks.
The text was updated successfully, but these errors were encountered:
Sounds a good idea. 👍 Feel free to open a PR @ZakRabe .
About the tests, the should accept custom configuration from the Config. will probably need an update. We will also probably need a test similar to should throw a ConfigTypeError when the value of "settings.ajv.allErrors" has an invalid type. but with the $data setting.
Today I was trying to use the
ValidateMultipartFormDataBody
hook to validate user registration data. But I ran into an issue with the AJV instanceIf I wanted to reference the value in the password, for the password confirmation, I would use a schema that looks like this
However AJV doesn't support this feature unless the
$data: true
option is passed at initialization. See here in the AJV documentation for the attribute.I saw in #633 that not all the options for the AJV instance are supported in the configuration, and you'd be adding support as they are requested.
I also confirmed for myself that the option isn't being passed.
foal/packages/core/src/common/utils/get-ajv-instance.ts
Lines 23 to 34 in 1dea1e4
Obviously its pretty simple to do this sort of check in the actual controller code, or another hook, so this issue isn't blocking.
However I think this usage of the JSON Schema to validate password confirmations is a pretty common use case, and warrants supporting in FoalTS.
If you'd like me to submit a PR, I'd be willing to, as it's a pretty trivial change. I'm just not sure how to best test a change like this to pass the PR approval process.
Thanks.
The text was updated successfully, but these errors were encountered: