-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
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:
//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;
}
openapi-generator version
First occured in Openapi-Generator 6.5.0. Still in current master
OpenAPI declaration file content or url
Generation Details
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