fix: schema2json传required参数时,导致faker失败

当传了required参数时,由于三目运算符属性写错,导致alwaysFakeOptionals属性设置错误
This commit is contained in:
Corey.Wang 2020-03-24 08:50:46 +08:00 committed by GitHub
parent 376473619b
commit 4d6132e4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1180,7 +1180,7 @@ class interfaceController extends baseController {
let required = ctx.request.body.required;
let res = yapi.commons.schemaToJson(schema, {
alwaysFakeOptionals: _.isUndefined(required) ? true : require
alwaysFakeOptionals: _.isUndefined(required) ? true : required
});
// console.log('res',res)
return (ctx.body = res);