According to OAS 3
Enums
You can use the enum keyword to specify possible values of a request parameter or a model property.
I believe possible values means that the ENUM values are the only valid values.
Currently this schema is generated for $expand, $select, and $orderby
{
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"enum": ["foo", "bar", "baz"]
}
}
}
I like to suggest this instead
{
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"anyOf": [
{
"type": "string",
"enum": ["foo", "bar", "baz"]
},
{
"type": "string"
}
]
}
}
}
This would allow tooling to suggest values while also accepting free form text.
I didn't reason about if using oneOf is more correct then anyOf.
According to OAS 3
I believe possible values means that the ENUM values are the only valid values.
Currently this schema is generated for $expand, $select, and $orderby
{ "schema": { "type": "array", "uniqueItems": true, "items": { "type": "string", "enum": ["foo", "bar", "baz"] } } }I like to suggest this instead
{ "schema": { "type": "array", "uniqueItems": true, "items": { "anyOf": [ { "type": "string", "enum": ["foo", "bar", "baz"] }, { "type": "string" } ] } } }This would allow tooling to suggest values while also accepting free form text.
I didn't reason about if using oneOf is more correct then anyOf.