Given a model with multiple inheritance levels and required parameters on each level of inheritance, the super calls in the constructor has the wrong order.
//SubType extends IntermediateSubType
public SubType(TypeEnum type, SchemaVersion schemaVersion, UUID id, Boolean oneBoolean, Boolean someBoolean, SomeEnum someEnum) {
super(someBoolean, someEnum, oneBoolean, schemaVersion, id);
this.type = type;
}
...
public IntermediateSubType(Boolean someBoolean, SomeEnum someEnum, SchemaVersion schemaVersion, UUID id, Boolean oneBoolean) {
super(oneBoolean, schemaVersion, id);
this.someBoolean = someBoolean;
this.someEnum = someEnum;
}
First occured in Openapi-Generator 6.5.0. Still in current master
Bug Report Checklist
Description
Given a model with multiple inheritance levels and required parameters on each level of inheritance, the super calls in the constructor has the wrong order.
Given the sample below without the fix:
openapi-generator version
First occured in Openapi-Generator 6.5.0. Still in current master
OpenAPI declaration file content or url
https://github.com/JanLubenow/openapi-generator/blob/1d39efec7e3e9f6a09b23b40236211ce0cec9705/modules/openapi-generator/src/test/resources/bugs/issue_constructor-required-values-with-multiple-inheritance.yaml
Generation Details
See https://github.com/JanLubenow/openapi-generator/blob/1d39efec7e3e9f6a09b23b40236211ce0cec9705/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java#L394
Used generator: Spring
Library: Spring Boot
Steps to reproduce
Run linked testcase without bugfix in SpringCodeGen.java
Related issues/PRs
#15796 (but addresses other issues in this area)
Suggest a fix
see #15827