Open taladar opened 1 month ago
Tuples don't seem to be supported exactly in OpenAPI but it would probably be possible to at least use anyOf and minItems and maxItems to get as close as OpenAPI allows the validation to go.
Alternatively if someone uses a tuple and it is not supported by utoipa at all it should probably lead to a compile error.
Given e.g.
we get
which seems to be the schema for a type that fulfills all the requirements at the same time instead of one where each element fulfills one of the requirements.
This happens for both enum and struct fields and it does not seem to matter if the field is named which leads me to conclude that the location of the tuple within the type we derive ToSchema on probably doesn't matter.