Closed RubberDuckShobe closed 3 weeks ago
I would say this is a duplicate for this #954. Since enums in general are represented in JSON Schema as enum: [...]
There is no way to add any description on them. https://json-schema.org/understanding-json-schema/reference/enum.
While this doc is for OpenAPI 3.0 https://swagger.io/docs/specification/v3_0/data-models/enums/ it contains an example of how to leverage a description field to further expand what the enums contains.
Also if you remove the repr(i16)
you will get enum that shows the names only. But those are the options basically. Anything else would need the enum itself not being represented as an enum but a type constructed from allOf
and other attributes necessary to represent type with name.
Thanks for the help, I'll see. Sorry for the duplicate
Hello, I have an enum like this:
In the OpenAPI spec that was generated, it only shows the integers, with no name at all:
Is there a way to specify the name for enum variants? It'd be great to be able to have the names in the spec as well.