Closed hrobertson closed 2 years ago
Field tags apply to the property for which they are defined, that's why you get enum
for days
and not for days/items
.
In such case (slice of strings) you can not use field tags to define enum
, but you can either create a named type and implement Enum() []interface{}
on it, or define schema preparer and set up enum in it.
Please check this example.
Thanks for the examples.
I have a field that is an array of enum values.
The OpenAPI spec to represent this is this:
I can not find how this can be represented in a go struct tag. This does not work:
It results in this incorrect (invalid?) OpenAPI schema:
Thanks