Unverified Commit ed1b9f3f authored by sean1025's avatar sean1025 Committed by GitHub

Merge pull request #1634 from 2234839/master

🐛 修复导出的swagger.json 中 required 一直是 false 的 bug
parents 7e055d33 74b39efc
......@@ -167,7 +167,7 @@ class exportSwaggerController extends baseController {
name: p.name,
in: 'header',
description: `${p.name} (Only:${p.value})`,
required: p.required === 1,
required: Number(p.required) === 1,
type: 'string', //always be type string
default: p.value
});
......@@ -187,7 +187,7 @@ class exportSwaggerController extends baseController {
paramArray.push({
name: p.name,
in: 'query',
required: p.required === 1,
required: Number(p.required) === 1,
description: p.desc,
type: 'string' //always be type string
});
......@@ -200,7 +200,7 @@ class exportSwaggerController extends baseController {
paramArray.push({
name: p.name,
in: 'formData',
required: p.required === 1,
required: Number(p.required) === 1,
description: p.desc,
type: p.type === 'text' ? 'string' : 'file' //in this time .formData type have only text or file
});
......@@ -285,4 +285,4 @@ class exportSwaggerController extends baseController {
}
}
module.exports = exportSwaggerController;
\ No newline at end of file
module.exports = exportSwaggerController;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment