-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Open
Labels
Description
Description
Openapigenerator 7.20.0 produces code that is not compiling when mixing serializableModel=true and useSealedOneOfInterfaces=true and having oneOf object in openapi spec. The reason it is not compiling is duplicated final keyword in generated class:
public final final class HelloADto implements Serializable, HelloResponseDto {openapi-generator version
7.20.0
OpenAPI declaration file content or url
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.20.0</version>
<executions>
<execution>
<configuration>
<configOptions>
<library>webclient</library>
<useJakartaEe>true</useJakartaEe>
<serializationLibrary>jackson</serializationLibrary>
<serializableModel>true</serializableModel>
<useOneOfInterfaces>true</useOneOfInterfaces>
<useSealedOneOfInterfaces>true</useSealedOneOfInterfaces>
</configOptions>
<generatorName>java</generatorName>
<inputSpec>${project.basedir}/src/main/resources/Test.yaml</inputSpec>
<generateApis>false</generateApis>
<generateModelTests>false</generateModelTests>
<generateSupportingFiles>false</generateSupportingFiles>
<modelNameSuffix>Dto</modelNameSuffix>
<modelPackage>com.test</modelPackage>
</configuration>
<goals>
<goal>generate</goal>
</goals>
<id>test-api</id>
</execution>
</executions>
</plugin>Generation Details
mvn clean package
Steps to reproduce
Generate dtos for the openapi config from above and the following sample openapi spec that causes compilation error:
<script src="https://gist.github.com/rafaljaw/d8fc792dee7ba9ac0b8a3d909eaf9c12.js"></script>
Related issues/PRs
Suggest a fix
Reactions are currently unavailable