[BUG] [jaxrs-spec] Cannot change names of API classes (no useTags option and apiNameSufix/apiNamePrefix don't work)
openapi-generator-maven-plugin 4.3.0 Generator jaxrs-spec
I haven't found any way to change class name for APIs generated by openapi-generator-maven-plugin with jaxrs-spec generator.
For example, if I have endpoint /my-api/v1/foo, the generator is going to always create MyApiApi class.
The generator does not have useTags option, as for example Spring generator. The generator also does not take into account additional properties apiNameSuffix and apiNamePrefix, when they are defined as:
<additionalProperties>
<additionalProperty>apiNameSuffix=RestApi</additionalProperty>
<additionalProperty>apiNamePrefix=Prefix</additionalProperty>
</additionalProperties>
When I have multiple resources, for example /my-api/v1/foo and /my-api/v1/bar, there is no option to put them into separate API classes (FooV1Api and BarV1Api).
Suggest a fix
I suggest to:
- Add useTags option to this generator
- Add apiNameSuffix and apiNamePrefix support for it
👋 @jimschubert
I'm struggling to config the name of a generated API client class.
I'm using the Gradle plugin to generate a Kotlin client from an OpenAPI v2 spec that doesn't have any tags, and it always results in a DefaultApi class.
Is there a plan to add apiNamePrefix to the Kotlin generator?
I noticed that there is a related PR, but that one doesn't seem to solve this use case.
Could you guide me on how to accomplish it? Or should I open a feature request?
👋 @jimschubert
I'm struggling to config the name of a generated API client class.
I'm using the Gradle plugin to generate a Kotlin client from an OpenAPI v2 spec that doesn't have any tags, and it always results in a
DefaultApiclass.Is there a plan to add
apiNamePrefixto the Kotlin generator?I noticed that there is a related PR, but that one doesn't seem to solve this use case.
Could you guide me on how to accomplish it? Or should I open a feature request?
do you add tags in your openapi doc? generator will generate the classes and them name is: tags name + ApiXxxxx, so,
- add tags in you openapi .yaml document;
- open use tags: useTags true /useTags