swagger-api / swagger-api/swagger-codegen-generators

jaxrs-resteasy processor generates invalid source code for enums

Open
#832 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Example of invalid code:

public enum CustomerStatus {
    {values=[N, P, A], enumVars=[{name=N, value="N"}, {name=P, value="P"}, {name=A, value="A"}]}
}

Apparently JavaJaxRS/resteasy/enumOuterClass.mustache template was not updated to accommodate to changes in enum representation introduced in 105872877

I've verfied that copying the contents of JavaJaxRS/resteasy/eap/enumOuterClass.mustache to JavaJaxRS/resteasy/enumOuterClass.mustache fixes the problem. I'll post a PR shortly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with JavaJaxRS/resteasy/enumOuterClass.mustache and compare it with JavaJaxRS/resteasy/eap/enumOuterClass.mustache, as the issue identifies both templates and the enum representation change. Reproduce the generated CustomerStatus example, then verify that the RESTEasy processor emits valid enum source matching the updated representation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.