swagger-api / swagger-api/swagger-codegen
[Android] android client should not depend on httpcore and httpclient-android if library = volley
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
When generating an Android client, the same pom template is always used, which has the dependencies for both httpclient and volley. This can cause build errors like "Program type already present: org.apache.http.annotation.NotThreadSafe"
If you remove the dependency to httpcore and httpclient-android the issue goes away
Swagger-codegen version
2.3.1
Steps to reproduce
Create client with java -jar swagger-codegen-cli-2.3.1.jar generate --lang android ....
Check the resulting pom.xml
Related issues/PRs
https://github.com/swagger-api/swagger-codegen/issues/4069
Suggest a fix/enhancement
Create two pom templates, on to be used with library=volley and one to be used when library=httpclient
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
Run the provided swagger-codegen generation command and inspect the generated pom.xml for the Android client. Trace the Android POM template selected by the library option, comparing library=volley with library=httpclient. Done means each generated POM includes only the dependencies appropriate to its selected library and avoids the reported duplicate classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100