【发布时间】:2019-12-27 19:54:24
【问题描述】:
我无法从我希望 swagger 从架构定义中生成的 json 请求正文中删除外部数组。
我要生成这个对象:
{
"name":
{
"value": "test04"
},
"mail": {
"value": "test04@gmail.com"
}
}
但招摇给我的是这个:
[
{
"name": {
"value": "string"
},
"mail": {
"value": "string"
}
}
]
这是我的定义部分:
definitions:
user:
type: "object"
properties:
name:
type: object
properties:
value:
type: string
mail:
type: object
properties:
value:
type: string
请您提供帮助。我是新来的。我使用的是 2.0 版
【问题讨论】:
-
您的架构定义是正确的。很可能在参数/请求正文/响应定义中的某处有一个额外的
type: array。你能发布问题操作的完整 YAML 吗? -
你是对的,谢谢你的帮助。如果您将此作为答案发布,我会接受它
标签: json object yaml swagger openapi