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

Support for enum descriptions (x-enum-descriptions) #1693

Open
jmini opened this issue Dec 17, 2018 · 5 comments
Open

Support for enum descriptions (x-enum-descriptions) #1693

jmini opened this issue Dec 17, 2018 · 5 comments

Comments

@jmini
Copy link
Member

jmini commented Dec 17, 2018

With #893 (comment) 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.

@tomghyselinck
Copy link
Contributor

This is also useful for Python docstrings.

@jmini
Copy link
Member Author

jmini commented Jan 9, 2019

@tomghyselinck: absolutely. The idea is to contribute this feature into the core. Then templates needs to be updated to use this feature if it makes sense.

Example:
20697ec#diff-c7ad5f298a44b19ad127f9a5fbcbd356

Can you open a PR to add the support in Python docstrings?

@jmini
Copy link
Member Author

jmini commented Jan 21, 2019

PR to generate the javadoc (using the JaxRS generator): #1951

@tomghyselinck
Copy link
Contributor

@jmini: I will try to do so in the next weeks

@shartte
Copy link
Contributor

shartte commented Jun 10, 2021

This seems to work for Java Enum Descriptions.

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

3 participants