OpenAPITools / OpenAPITools/openapi-generator
[BUG] Generated resources with wrong package name
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issuue still exists?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Generated resources with wrong package name
openapi-generator version
4.3.1
Generation Details
After put generation details in pom files, the sources can be generated. However, after generate all classes/interface have the wrong package name. An extra fre-fix "openapi.src.main.java" is added to the generated package deceleration.
plugin config in pom.xml are shown below

difference between generated package name and actual package name are shown in figs below:


Steps to reproduce
- put plugin in pom.xml file
- run mvn clean
- run mvn generate-sources
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 plugin configuration in pom.xml and reproduce the issue using mvn clean followed by mvn generate-sources. Compare the generated class and interface package declarations with the configured package name; done means the extra "openapi.src.main.java" prefix is no longer present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100