【发布时间】:2016-08-01 10:06:13
【问题描述】:
我目前正在寻找一种将 JSON 包装到 Swagger UI 组件中的方法。
在 YAML 中,我的对象声明是:
restException:
properties:
message:
type: string
Swagger UI 生成的输出是(我同意,是正确的):
{
"message": "string"
}
而我想要的是:
"restException": {
"message": "string"
}
我只是通过在 YAML 文件中明确声明包装器找到了一种丑陋的方法。但这很糟糕,因为它也是在我使用“Swagger Codegen”生成客户端或服务器代码时生成的。
restExceptionContainer:
restException:
properties:
message:
type: string
如果需要,我可以在 Swagger UI 文件中添加代码!需要您的帮助才能找到位置:)
【问题讨论】:
标签: json swagger swagger-ui swagger-2.0 swagger-editor