37 lines
704 B
JavaScript
37 lines
704 B
JavaScript
const commonSchemas = require(`../../validation/commonSchemas`);
|
|
|
|
const login = {
|
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
title: "Login User",
|
|
description: "An object to log-in a new user",
|
|
type: "object",
|
|
properties: {
|
|
email: commonSchemas.email,
|
|
password: {
|
|
type: "string",
|
|
},
|
|
},
|
|
required: ["email", "password"],
|
|
};
|
|
|
|
const create = {
|
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
title: "Create User",
|
|
description: "An object to create a new user",
|
|
type: "object",
|
|
properties: {
|
|
email: commonSchemas.email,
|
|
password: {
|
|
type: "string",
|
|
minLength: 10,
|
|
maxLength: 50,
|
|
},
|
|
},
|
|
required: ["email", "password"],
|
|
};
|
|
|
|
module.exports = {
|
|
login,
|
|
create
|
|
};
|