Mik*_*ike 3 arrays swagger openapi
我希望发布一个包含可变数量字符串的数组,例如
[“ string1”,“ string2”,...“ stringN”]
我现在的OpenAPI文档是这样定义的:
schema:
type: array
items:
description: networkIds
type: string
Run Code Online (Sandbox Code Playgroud)
这是按照OpenAPi v3规范进行编码的正确方法,还是有一种更精确的方法来指示数组中的一个或多个字符串?
缩进是错误的- type而且items必须是在同一水平上。
如果数组不能为空并且始终至少包含一项,则可以添加minItems: 1作为附加约束。如果所有项目必须唯一,请添加uniqueItems: true。
schema:
type: array
items:
description: networkIds
type: string
minItems: 1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1631 次 |
| 最近记录: |