swagger-api / swagger-api/swagger-codegen
Missing Jackson imports
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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