Bug Report Checklist
Description
After this change #14822 now when adding <additionalModelTypeAnnotations>@lombok.experimental.SuperBuilder</additionalModelTypeAnnotations> compilation might be broken
If object have some required parameters then everything works fine, but as soon as you have object without required parameters you are getting model where only "all args constructor" is present(generated by lombok) and there is no "no arg constructor"
Before this change I usually configured my models with <additionalModelTypeAnnotations>@lombok.AllArgsConstructor;@lombok.NoArgsConstructor;@lombok.experimental.SuperBuilder</additionalModelTypeAnnotations> so at the end I got "all args" & "no args" constructor generated by lombok
openapi-generator version
6.5.0-SNAPSHOT (not released yet)
OpenAPI declaration file content or url
any model with at least one property and there are no required properties
Generation Details
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.5.0-SNAPSHOT</version>
<configuration>
<generateSupportingFiles>true</generateSupportingFiles>
<modelNameSuffix>Dto</modelNameSuffix>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<generateApiDocumentation>false</generateApiDocumentation>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<dateLibrary>java8</dateLibrary>
<useTags>true</useTags>
<openApiNullable>false</openApiNullable>
<skipDefaultInterface>true</skipDefaultInterface>
<documentationProvider>springfox</documentationProvider>
</configOptions>
</configuration>
<executions>
<execution>
<id>generate-openapi-for-backend</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/contract/_index_auto.yaml</inputSpec>
<generatorName>spring</generatorName>
<configOptions>
<additionalModelTypeAnnotations>@lombok.AllArgsConstructor;@lombok.NoArgsConstructor;@lombok.experimental.SuperBuilder</additionalModelTypeAnnotations>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
Steps to reproduce
Related issues/PRs
#14822
Suggest a fix
add option generatedRequiredParametersConstructor=false. By default it should be false, because this new option will broke compilation as it's in my case
@alucas could you please implement this? Please ping if you have no time, then I can pick this one
Bug Report Checklist
Description
After this change #14822 now when adding
<additionalModelTypeAnnotations>@lombok.experimental.SuperBuilder</additionalModelTypeAnnotations>compilation might be brokenIf object have some required parameters then everything works fine, but as soon as you have object without required parameters you are getting model where only "all args constructor" is present(generated by lombok) and there is no "no arg constructor"
Before this change I usually configured my models with
<additionalModelTypeAnnotations>@lombok.AllArgsConstructor;@lombok.NoArgsConstructor;@lombok.experimental.SuperBuilder</additionalModelTypeAnnotations>so at the end I got "all args" & "no args" constructor generated by lombokopenapi-generator version
6.5.0-SNAPSHOT (not released yet)
OpenAPI declaration file content or url
any model with at least one property and there are no required properties
Generation Details
Steps to reproduce
Related issues/PRs
#14822
Suggest a fix
add option
generatedRequiredParametersConstructor=false. By default it should be false, because this new option will broke compilation as it's in my case@alucas could you please implement this? Please ping if you have no time, then I can pick this one