mirror of https://gitee.com/bigwinds/arangodb
Wrap non-Joi objects as Joi schemas.
This commit is contained in:
parent
233f21662a
commit
2747bf8b04
|
@ -269,7 +269,9 @@ _.extend(Model.prototype, {
|
||||||
metadataSchema[attributeName] ||
|
metadataSchema[attributeName] ||
|
||||||
joi.forbidden()
|
joi.forbidden()
|
||||||
),
|
),
|
||||||
result = schema.validate(value);
|
result = (
|
||||||
|
schema.isJoi ? schema : joi.object().keys(schema)
|
||||||
|
).validate(value);
|
||||||
|
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
this.errors[attributeName] = result.error;
|
this.errors[attributeName] = result.error;
|
||||||
|
|
Loading…
Reference in New Issue