swagger-api / swagger-api/swagger-codegen
[JAVA] Bug. The configuration of dateLibrary does not take effect.
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When I use swagger-codegen-cli to generate java client, I found that no matter how my dateLibrary config is configured, such as {"dateLibrary": "java11"}, the generated model code will import org.joda.time.*.
Swagger-codegen version
3.0.34
Swagger declaration file content or url
Command line used for generation
java -jar swagger-codegen-cli.jar generate \
-l java \
-o ./java-sdk \
-i ./docs/api-0.3.0.yaml \
-s false \
-c java-sdk-config.json \
java-sdk-config.json
{
"dateLibrary": "java11",
"fullJavaUtil": true ,
"library": "retrofit2"
}
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
Start by reproducing the generation command with java-sdk-config.json and inspect the generated model imports. Trace how the Java generator handles the dateLibrary setting and which Mustache templates produce the model code. Done means a java11 configuration no longer generates org.joda.time imports, with the relevant generation behavior covered by tests if existing tests can be located.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100