使用swagger 2.0规范,我正在描述添加新资源的“操作”:
包含3个参数的POST请求:
{
name: "username",
in: "header",
description: "New user unsername",
required: true,
type: "string"
},
{
name: "password",
in: "header",
description: "New user password",
required: true,
type: "string"
},
{
name: "pensis",
in: "body",
description: "New pensis to create",
required: true,
schema: {
properties: {
content: {
type: "string",
description: "Content of this pensis stored as markdown text"
}
}
}
}
我使用前面的3个参数设置POST请求:
我发送POST请求,当我使用 swagger-tool metadata 0.8.6 中间件解析它时,我收到一个奇怪的回复:
此中间件提供的 req.swagger.params.pensis.value 的值不是:
{ content: 'The content' }
但:
{ content: 'The content',
username: 'ClementVidal',
password: 'r'
}
您是否知道为什么这3个参数在同一个pensis对象中合并在一起?
感谢您的帮助
ClémentVidal