我想描述返回未知/任何类型的 JSON 对象的 OpenAPI。
如果我在下面的 yaml 中定义返回类型,我仍然会看到生成的客户端仅返回原始字符串。
responses:
200:
description: Returns any JSON object
schema:
type: string
format: object
Run Code Online (Sandbox Code Playgroud)
有没有办法将返回类型描述为 JSON 对象而不描述其架构?
任意对象定义为type: object,因此正确的定义是:
responses:
200:
description: Returns any JSON object
schema:
type: object
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3487 次 |
| 最近记录: |