Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] enum: description and value #829

Open
jmini opened this issue Jun 28, 2019 · 0 comments
Open

[feature] enum: description and value #829

jmini opened this issue Jun 28, 2019 · 0 comments

Comments

@jmini
Copy link

jmini commented Jun 28, 2019

The OpenAPI is not really supporting Enum with description and value.

There is an OpenAPI discussion (OAI/OpenAPI-Specification#681 (comment)) suggesting that this notation could be used:

oneOf:
  - enum: [1]
    title: Sunny
    description: Blue sky
  - enum: [2]
    title: Cloudy
    description: Slightly overcast
  - enum: [3]
    title: Rainy
    description: Take an umbrella with you

Other tool (OpenAPI-Generator) uses following extensions x-enum-descriptions and x-enum-varnames:

WeatherType:
  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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants