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
20.51k stars 6.27k forks source link

Disable appending `def` to generated class names after upgrading from 5.30 -> 7.6.0 #18990

Open drewjocham opened 1 week ago

drewjocham commented 1 week ago
Description

After upgrading the openapi-generator-maven-plugin from version 5.3.0 to 7.6.0 def is appended to all the generated class names. Example Action.java is now Actiondef.java. The only thing that has changed is the version. How can we stop this from happening?

openapi-generator version
<version>7.6.0</version>   
OpenAPI declaration file content or url
<plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <version>7.6.0</version>
        <executions>
          <execution>
            <id>generate-java</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <configOptions>
                <useJakartaEe>true</useJakartaEe>
                <sourceFolder>.</sourceFolder>
                <interfaceOnly>true</interfaceOnly>
                <useTags>true</useTags>
                <dateLibrary>java8</dateLibrary>
                <java8>true</java8>
                <reactive>false</reactive>
                <useBeanValidation>true</useBeanValidation>
                <performBeanValidation>true</performBeanValidation>
                <useOptional>true</useOptional>
                <serviceInterface>false</serviceInterface>
                <serviceImplementation>false</serviceImplementation>
              </configOptions>
              <generateAliasAsModel>false</generateAliasAsModel>
              <generateApiDocumentation>true</generateApiDocumentation>
              <generateApis>false</generateApis>
              <generateApiTests>false</generateApiTests>
              <generateModelDocumentation>true</generateModelDocumentation>
              <generateModels>true</generateModels>
              <generateModelTests>true</generateModelTests>
              <generateSupportingFiles>false</generateSupportingFiles>
              <generatorName>spring</generatorName>
             <inputSpec>${generated.sources.openapi}/EtlConfiguration.api.json</inputSpec>
              <typeMappings>map=java.util.Map</typeMappings>
              <modelPackage>etl.product.configuration.models</modelPackage>
              <output>${generated.sources.java}</output>
            </configuration>
          </execution>
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
wing328 commented 1 week ago

can you please share the spec?

don't think we add the def suffix to the model name behind the scene

drewjocham commented 1 week ago

@wing328 Thanks for responding. Are you referring to a xxx.api.json file or xxx.def.json file?

drewjocham commented 3 days ago

bump. There was a change between 5.4.x and 6.1.x. After 6.1.x def is appended to all my entities.