Del*_*D0D 13 swagger swagger-editor
我正在使用YAML在Swagger编辑器中进行API定义.我试图代表以下响应主体:
{
success: true,
ids: [123456, ...]
}
Run Code Online (Sandbox Code Playgroud)
这就是我的YAML的样子:
definitions:
SuccessfulResponse:
type: object
properties:
success:
type: boolean
description: True if the all operations were successful
ids:
type: array
items:
id:
type: string
Run Code Online (Sandbox Code Playgroud)
香港专业教育学院尝试了几种不同的方式,但是这样看似无效
如何正确描述上面给出的返回对象?
Wil*_*eng 18
以下是将属性定义为字符串数组的示例:
photoUrls:
type: array
items:
type: string
Run Code Online (Sandbox Code Playgroud)
参考:https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml#L661-L667
| 归档时间: |
|
| 查看次数: |
19827 次 |
| 最近记录: |