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

Integer enum with value description #226

Open
sbahloul opened this issue Aug 8, 2024 · 1 comment
Open

Integer enum with value description #226

sbahloul opened this issue Aug 8, 2024 · 1 comment

Comments

@sbahloul
Copy link

sbahloul commented Aug 8, 2024

First of all, thank you for the great work.

Quick question: which annotations should be used to specify an integer enum with values description ?

components:
  schemas:
    RequestTypeEnum:
      type: integer
      enum:
        - 1
        - 2
      description: >
        Sort order:
          * `1` - Description of the requestType = 1
          * `2` - Description of the requestType = 2

Thank you,
Sebastien

@dzikoysk
Copy link
Member

dzikoysk commented Aug 9, 2024

Hey, thanks :)

Unfortunately, it's currently not possible to declare enums as ints. We're only supporting string values that are valid Java/Kotlin identifiers for name-based matching. We'd need to implement something like @IndexedEnum to enforce position based schema 🤔

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