【发布时间】:2019-06-20 08:00:56
【问题描述】:
Swagger documentation explains how to define arrays that contain mixed types,如["foo", 5, -2, "bar"]。但是,我如何定义一个数组必须包含一个一种类型的项目(字符串,["foo", "bar"])或另一种(整数,[5, -2])?
这个我试过了,但是Swagger UI不能渲染,所以我猜是错的:
oneOf:
- items:
- $ref: '#/components/schemas/SchemaA'
- items:
- $ref: '#/components/schemas/SchemaB'
【问题讨论】:
标签: swagger swagger-ui openapi