This will depend on what you want to list:
Each enumeration value MUST be of a described object type
- in the first case String
- in the second array array row
The first syntax is the possible String values ββin this array
AnArray: type: array items: type: string enum: - MALE - FEMALE - WORKER
This array can contain several rows, but each row must have the value MALE, FEMALE or WORKER.

The second means that these are the possible values ββof this array
AnotherArray: type: array items: type: string enum: - - FEMALE - WORKER - - MALE - WORKER
Each enumeration value is an array. In this example, this array can only have the possible value ["FEMALE", "WORKER"] and ["MALE", "WORKER"].
Unfortunately, even if this syntax is valid, there are no enum values ββin the Swagger interface.
source share