luolingchun / flask-openapi3

Generate REST API and OpenAPI documentation for your Flask project.
https://luolingchun.github.io/flask-openapi3/
MIT License
203 stars 33 forks source link

ServerVariable.enum should be optional #188

Closed Soremwar closed 1 week ago

Soremwar commented 4 weeks ago

Per https://spec.openapis.org/oas/v3.1.0#fixed-fields-4, enum is An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty.

I think this was interpreted as enum being a required property, when in reality it's optional and treating it as such removes the ability for applications to set the specificied variables with an arbitrary value

Without enum: image

With enum: image

luolingchun commented 3 weeks ago

Thanks for your report, I will fix it.