How can I define an array object property, that contains several items in a comma separated string in openapi-v3?
I want to validate a request body (not query parameter!) like this:
{
"friends": "Ann,Bob"
}
I am dreaming of an openApi v3 schema definition like this one:
"friends": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Ann",
"Bob",
"Charlie"
]
},
"commaSeparation": ",", // does not exist
}
Is there a officially supported way to describe such string contents? If not: What could be a workaround, that still precisely defines and validates those texts?