swagger-api / swagger-api/swagger-codegen

Missing Jackson imports

Open
#9,362 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When using jaxrs-spec to generate code, several imports to jackson annotations are missing, and the generated code does not compile.

Swagger-codegen version

maven plugin 3.0.7

Swagger declaration file content or url

The petstore example is experiancing this too. https://github.com/swagger-api/swagger-codegen/blob/master/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java demonstrates the problem I'm seeing @JsonValue and @JsonCreator are used but not imported.

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

Inspect the generated sample at samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java and confirm that @JsonValue and @JsonCreator are used without imports. Reproduce generation with the Maven plugin version 3.0.7, then verify the generated Java code compiles with the required Jackson annotations available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.