Vih*_*ung 8 collections yaml swagger
我正在为API编写一个昂首阔步的定义文件.API是用于GET请求的
/path/to/my/api:
get:
summary: My Custom API
description: |
Gets a List of FooBar IDs
produces:
- application/json
tags:
- FooBar
responses:
"200":
description: successful operation
schema:
$ref: "#/definitions/MyCustomType"
Run Code Online (Sandbox Code Playgroud)
...
MyCustomType:
type: object
properties:
myCustomObject
type: ??? # list of string?
Run Code Online (Sandbox Code Playgroud)
Wil*_*eng 13
对于字符串列表,您可以描述如下:
type: array
items:
type: string
Run Code Online (Sandbox Code Playgroud)
参考:https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject
例: