lnash94
3 years agoOccasional Contributor
How to document multiple data types array in OpenAPI Definition
Hi all, I'm looking for an OpenAPI representation for an array type when the array has one specific data type item at one time, the array data type can be multiple types. That means as an example: ...
- 3 years ago
You are almost there. Here's how to define a non-mixed array:
arry: oneOf: - type: array items: type: integer - type: array items: type: string
Depending on how well your tooling handles "oneOf", this can be simplified into:
arry: type: array oneOf: - items: type: integer - items: type: string