added required parameter range

This commit is contained in:
VLE2FE
2020-08-24 15:24:55 +02:00
parent 65f740af77
commit bf02c1b99e
2 changed files with 8 additions and 9 deletions

View File

@ -153,13 +153,12 @@ export class ValidationService {
max: Joi.number(),
type: Joi.string()
.valid('array')
.valid('string', 'number', 'boolean', 'array'),
required: Joi.boolean()
})
.oxor('values', 'min')
.oxor('values', 'max')
.oxor('type', 'values')
.oxor('type', 'min')
.oxor('type', 'max')
.required()
.validate(JSON.parse(data));
if (error) {