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:
let’s assume I have an array called arry with two data types integer and string, when I receive arry, It can be contained items only one type. It can be an integer array(arry[] → [integer, integer, integer]) or string array (arry[] → [string, string, string]).
If I use oneOf data model :
…
arry:
type: array
items:
oneOf:
- type: string
- type: integer
it will return the mixed type array arry[]->[integer, string, integer, integer, string]
Could you please let me know, how can I represent array arry[] → [integer, integer, integer] or arry[] → [string, string, string] in the OpenAPI definition?
I’m trying to do a mixed type array for a body parameter called params using the “anyOf” param but it seems to only let me choose ONE of the options instead of adding both into the array. For context, the request I’m trying to replicate looks like this: