swagger-api / swagger-api/swagger-codegen
[JAVA] Unable to modify the host without overwriting the whole base path
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The Java client base path includes the hostname (defaulting to localhost), as well as the rest of the base path defined in the yaml. The only method to set the base path overwrites everything, so I can't set the host without overwriting the rest of the basePath which I want to keep.
Swagger-codegen version
2.4.0
Swagger declaration file content or url
basePath: /v2
Steps to reproduce
Online editor, Java client: https://editor.swagger.io/
Produces basePath of http://petstore.swagger.io/v2 with no method available to change the petstore.swagger.io bit without also losing the v2
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 with the generated Java client's base-path setter and the Java generation templates used by the online editor. Reproduce the generated client with basePath /v2, then determine how the hostname can be changed without removing /v2. Done means the generated client exposes that host-only change while preserving the declared base path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100