Bug Report Checklist
Description
See attached yaml file. When generating with
<generatorName>java</generatorName>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<delegatePattern>true</delegatePattern>
<openApiNullable>false</openApiNullable>
<useBeanValidation>true</useBeanValidation>
<library>feign</library>
</configOptions>
The class SecondDerivation contains a constructor that tries to set the fields id and href which are actually in class FirstDerivation. Since the fields are private this can not work.
openapi-generator version
Version 6.5
OpenAPI declaration file content or url
Yaml file attached.
Generation Details
Steps to reproduce
Generate a model from the yaml with the above options.
Related issues/PRs
This issue shows a very similar, or maybe even the same problem:
#13253
Suggest a fix
The Spring generator implements the postProcessAllModels method and handles this perfectly by calling the constructor of the base class instead of trying to set the variables. As a temporary fix I changed the pojo.mustache of the Java generator in my project, but I am not sure this fixes all problems.
simpleAPI.zip
Bug Report Checklist
Description
See attached yaml file. When generating with
<generatorName>java</generatorName><configOptions><interfaceOnly>true</interfaceOnly><delegatePattern>true</delegatePattern><openApiNullable>false</openApiNullable><useBeanValidation>true</useBeanValidation><library>feign</library></configOptions>The class SecondDerivation contains a constructor that tries to set the fields id and href which are actually in class FirstDerivation. Since the fields are private this can not work.
openapi-generator version
Version 6.5
OpenAPI declaration file content or url
Yaml file attached.
Generation Details
Steps to reproduce
Generate a model from the yaml with the above options.
Related issues/PRs
This issue shows a very similar, or maybe even the same problem:
#13253
Suggest a fix
The Spring generator implements the postProcessAllModels method and handles this perfectly by calling the constructor of the base class instead of trying to set the variables. As a temporary fix I changed the pojo.mustache of the Java generator in my project, but I am not sure this fixes all problems.
simpleAPI.zip