I am trying to create an endpoint that returns the possible values of an enum with OpenAPI specification and I don't see how to do it reusing the already defined enum.
Is it possible to do it and if so what should be the best practice?
Edit:
This is how I am doing it now. It is creating correct clients but the examples are wrong as it is creating an array with just one of the elements from the enumeration.
Enum:
DateGenerationRule:
type: string
enum: &DATEGENERATIONRULE
- Backward
- CDS
- Forward
- OldCDS
- ThirdWednesday
- Twentieth
- TwentiethIMM
- Zero
Response:
GetDateGenerationRulesResponse:
type: object
properties:
message:
type: object
properties:
...
BusinessDayConvention:
type: array
items:
$ref: '#/components/schemas/DateGenerationRule'
...