OpenAPITools / OpenAPITools/openapi-generator
[REQ] easier and more consistent package name configuration
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
With openapi-generator-plugin 4.3.0, there are currently 4 package name configuration options:
- packageName
- apiPackage
- modelPackage
- invokerPackage
In configOptions, you can even specify a basePackage, adding more options for confusion...
Note that even the name of the options is not consistent;)
It is rarely needed to tweak each and every single option individually, I guess most projects will just want to define one name that is then suffixed with api and model, respectively.
So I'd propose to:
- use
packageNamesynonymously withbasePackageand use that as a base name for all other package names by default, unless explicitly overridden with the existing options - deprecate all other package options and introduce
apiPackageSuffixandmodelPackageSuffixetc. to fine tune those if really needed (default should beapi,model,… instead of the current...apiPackagewhich is redundantly including "package" in the name itself - don't default to
openapi.generator.maven.pluginsince this won't make sense for any project except for this one - a better default would be to use the groupId+artifactId from the POM of the project that uses openapi-generator
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 tracing how packageName, basePackage, apiPackage, modelPackage, and invokerPackage are handled in the openapi-generator-plugin 4.3.0 configuration. Review the plugin's Maven project defaults, including groupId and artifactId handling, before deciding how suffixes and deprecated options should interact. Done means one consistent base package, configurable suffixes, preserved overrides, and an appropriate project-derived default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100