Skip to content
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

Validate email in request #13

Open
markCwatson opened this issue Aug 13, 2023 · 0 comments
Open

Validate email in request #13

markCwatson opened this issue Aug 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@markCwatson
Copy link
Owner

markCwatson commented Aug 13, 2023

Right now, the request validation does not check if the email is a standard email format. We are using express-json-validator-middleware v3.0.1, but when I add "format": "email" to the email properties in the schema, I see the following error. This appears to be supported in older versions (ex. v2.2.1).

Error: unknown format "email" ignored in schema at path "#/properties/email"
at unknownFormat (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/vocabularies/format/format.js:63:23)
at validateFormat (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/vocabularies/format/format.js:50:17)
at Object.code (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/vocabularies/format/format.js:22:13)
at keywordCode (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/compile/validate/index.js:464:13)
at /app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/compile/validate/index.js:222:17
at CodeGen.code (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/compile/codegen/index.js:439:13)
at CodeGen.block (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/compile/codegen/index.js:568:18)
at iterateKeywords (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/compile/validate/index.js:219:9)
at groupKeywords (/app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/compile/validate/index.js:200:13)
at /app/node_modules/express-json-validator-middleware/node_modules/ajv/dist/compile/validate/index.js:192:13
Closing database connection...

@markCwatson markCwatson added the bug Something isn't working label Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant