openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

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

Open drewjocham opened this issue 1 year ago • 3 comments

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

drewjocham avatar Jun 21 '24 06:06 drewjocham

can you please share the spec?

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

wing328 avatar Jun 21 '24 08:06 wing328

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

drewjocham avatar Jun 21 '24 09:06 drewjocham

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

drewjocham avatar Jun 25 '24 12:06 drewjocham

I had files name foo.def.json. Removing the def from the files resolved the issue.

drewjocham avatar Jul 19 '24 12:07 drewjocham