OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
22.04k stars 6.61k forks source link

[REQ][Spring] Support apiNamePrefix and apiNameSuffix #8655

Open gopenguin opened 3 years ago

gopenguin commented 3 years ago

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

I'd like to generate api clients for Ory Hydra and Ory Kratos. My current problem is, that both specs use the tags admin and public. This leads to equally named api client classes from both specs (AdminApiClient and PublicApiClient). Therefore I'd like to prefix the generated api clients with the service name to avoid collisions and improve the readability of my code.

Describe the solution you'd like

I'd like to extend SpringCodegen to support config options apiNamePrefix and apiNameSuffix like the DefaultCodegen does.

Describe alternatives you've considered

I didn't find any other options to change the class name of the generated api definitions.

Additional context

Schemas with colliding tag definitions:

gopenguin commented 3 years ago

I'm happy to provide an PR with a possible solution, if you'd like.