-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
We created a custom format for phone numbers. As it is a function and not a regexp, I tried to pass it to Ajv via the following options:
this.validator = buildSchemaSync(this.spec, {
ajvConfigParams: {
formats: {
email: emailValidator.validate,
phone: phoneValidator.validate, // <-
},
},
})
For request parameters, this is working fine, but when I validate arequest body with this format, it failing with the following message:
Error: unknown format "phone" is used in schema at path "#/anyOf/1/properties/phoneNumber"
Metadata
Metadata
Assignees
Labels
No labels