-
Notifications
You must be signed in to change notification settings - Fork 26
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
Error: unknown format "email" #112
Comments
Well, I've done like this...
Not sure if it's the best approach, but at least it seems to work. |
The Ajv instance is available via the
Related documentation: https://github.com/simonplend/express-json-validator-middleware#ajv-instance |
Aww... I totally missed that one. Thank you. |
No problem! I'll see if I can improve this part of the docs, perhaps by adding a more concrete example with |
Hello,
I'm trying to use the email format, but no success.
Here's the schema:
{ "type": "object", "required": ["email", "password"], "properties": { "email": { "type": "string", "format": "email" }, "password": { "type": "string" } } }
Then when the server is starting (even before any request), I get this error:
Error: unknown format "email" ignored in schema at path "#/properties/email"
My Validator is being stantiated with this:
const { validate } = new Validator({ allErrors: true });
If I remove "format": "email" from the schema, validation works fine.
What I'm doing wrong?
Edit: already installed ajv-formats package too, but no success; I don't know how to add the formats I would like to use and connect with the middleware.
The text was updated successfully, but these errors were encountered: