Use AJV, refactor a lot

This commit is contained in:
2020-11-18 21:02:16 -06:00
parent ddf1a833d6
commit 95d7360ee4
8 changed files with 96 additions and 64 deletions

View File

@@ -0,0 +1,19 @@
const sharedSchemas = require(`../schemas`);
module.exports = {
"create": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Create User",
"description": "An object to create a new user",
"type": "object",
"properties": {
"email": sharedSchemas.email,
"password": {
"type": "string",
"minLength": 10,
"maxLength": 50
}
},
"required": ["email", "password"]
}
};