OpenAPITools / OpenAPITools/openapi-generator
Support for enum descriptions (x-enum-descriptions)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
With https://github.com/OpenAPITools/openapi-generator/issues/893#issuecomment-416617460 we have introduced support for the x-enum-varnames extension.
In a similar way x-enum-descriptions should be supported:
weather:
type: object
properties:
type:
type: integer
format: int32
enum:
- 1
- 2
- 3
x-enum-descriptions:
- 'Blue sky'
- 'Slightly overcast'
- 'Take an umbrella with you'
x-enum-varnames:
- Sunny
- Cloudy
- Rainy
The java generator could add some Javadoc on top of the enum value.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing x-enum-varnames support referenced in the issue and locate how the Java generator renders enum values. Trace the generated Java enum output for the supplied OpenAPI example, then verify that x-enum-descriptions produces Javadoc for each value without changing generation when descriptions are absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100