A bunch of helpers for JSON schema
var V = require("schema-ast");
var requestSchema = V.http.Request({
method: 'POST',
body: {
email: V.email(),
confirmEmail: V.email(),
password: V.string({
'minLength': 8,
'maxLength': Infinity
})
}
});
var responseSchema = V.union([
V.http.Response({
statusCode: 200,
body: schemas.UserModel
}),
V.http.TypedError({
statusCode: 400,
type: 'services.user.duplicate-email'
}, {
email: V.string()
}),
V.http.TypedError(LoggedInError),
V.http.TypedError(EmailNotSameError)
]);// TODO. State what the module does.
npm install schema-ast
npm test
- Raynos