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

[BUG] JAXRS-SPEC enum x-enum-varnames and x-enum-descriptions not generating as expected #20488

Open
5 of 6 tasks
JM92103 opened this issue Jan 16, 2025 · 0 comments
Open
5 of 6 tasks

Comments

@JM92103
Copy link

JM92103 commented Jan 16, 2025

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When using JAXRS-SPEC, the x-enum-varnames and x-enum-descriptions do not seem to work together.

openapi-generator version

7.10.0

OpenAPI declaration file content or url
type: integer
format: int32
enum:
  - 1000
  - 900
  - 30
  - 20
  - 10
  - 0
x-enum-descriptions:
  - 'UNEXPECTED ERROR'
  - 'REJECT'
  - 'REFER EXCEPTION'
  - 'REFER'
  - 'REFER OVERRIDE'
  - 'NONE'
x-enum-varnames:
  - UNEXPECTED_ERROR
  - REJECT
  - REFER_EXCEPTION
  - REFER
  - REFER_OVERRIDE
  - NONE
Generation Details
Steps to reproduce

Using the above YAML, I would expect the generated enum to look something like

public enum Severity {

    UNEXPECTED_ERROR(1000, "UNEXPECTED ERROR"),
    REJECT(900, "REJECT"),
    REFER_EXCEPTION(30, "REFER EXCEPTION"),
    REFER(20, "REFER"),
    REFER_OVERRIDE(10, "REFER OVERRIDE"),
    NONE(0, "NONE");
   
    ...
}

Whereas it is being generated as

public enum Severity {

  UNEXPECTED_ERROR(1000),
  REJECT(900),
  REFER_EXCEPTION(30),
  REFER(20),
  REFER_OVERRIDE(10),
  NONE(0);

...

}
Related issues/PRs
Suggest a fix
@JM92103 JM92103 changed the title [BUG] JAXRS-SPEC [BUG] JAXRS-SPEC enum x-enum-varnames and x-enum-descriptions not generating as expected Jan 16, 2025
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

1 participant