OpenAPITools / OpenAPITools/openapi-generator
[BUG][Java] templated servers broke simple setting of basepath
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- What's the version of OpenAPI Generator used?
4.3.0 - Have you search for related issues/PRs?
yes
Description
when the basepath for a generated api client is changed, that change get's ignored. cause is a check for
serverIndex != null
but the variable is initialized to 0
openapi-generator version
4.3.0 , yes. regression from 4.2.3
Related issues/PRs
probably introduced from https://github.com/OpenAPITools/openapi-generator/pull/4998
Suggest a fix
workaround is to either set the serverIndex to null explicitly, or add a single server configuration.
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 Java templated-server handling around the serverIndex != null check and compare the 4.3.0 regression with 4.2.3 and PR #4998. Verify that changing the basepath on a generated API client is honored without explicitly setting serverIndex to null or adding a server configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100