Skip to content

[REQ] basePackage option does not apply to apiPackage and modelPackage in kotlin-spring generator #21249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kdhyo opened this issue May 9, 2025 · 0 comments

Comments

@kdhyo
Copy link

kdhyo commented May 9, 2025

Is your feature request related to a problem? Please describe.

When using the kotlin-spring generator, I noticed that setting the basePackage option does not automatically apply to apiPackage and modelPackage. I expected that specifying basePackage would serve as the root, and the generator would place APIs under basePackage.api and models under basePackage.model.

However, even when basePackage is set, I still have to manually define apiPackage and modelPackage. Otherwise, the generated files are not placed as expected. I'm wondering if this is an intentional behavior or an area that could be improved for consistency.

Describe the solution you'd like

I would like the generator to treat basePackage as the root namespace, so that:

  • API classes are generated under basePackage.api
  • Model classes are generated under basePackage.model

Unless explicitly overridden by apiPackage or modelPackage.

Describe alternatives you've considered

Additional context

If this behavior is intended for backward compatibility reasons, I understand that it might be difficult to change.
However, if it's by design, I would appreciate a brief explanation of the rationale behind it.

I am using OpenAPI Generator 7.4.0 with Gradle. This behavior was observed using the kotlin-spring generator. Making basePackage behave as a true base path would help simplify configuration and reduce duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant