我目前正在寻找一种将 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 文件中添加代码!需要您的帮助才能找到位置:)