mirror of
https://github.com/YMFE/yapi.git
synced 2025-03-31 14:50:26 +08:00
fix: schema2json传required参数时,导致faker失败
当传了required参数时,由于三目运算符属性写错,导致alwaysFakeOptionals属性设置错误
This commit is contained in:
parent
376473619b
commit
4d6132e4e9
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user