OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When using inheritance via allOf the setters always return the type they are declared on, so using setters declared on the parent type will return Parent instead of Child.
Bug Report Checklist
Description
When using inheritance via allOf the setters always return the type they are declared on, so using setters declared on the parent type will return
Parent
instead ofChild
.openapi-generator version
6.4.0
OpenAPI declaration file content or url
Generation Details
https://github.com/gradle/gradle-enterprise-api-samples/blob/5b9a67556042413337860c47532512046f8765a0/build.gradle.kts#L35-L57
Steps to reproduce
Checkout the demo at https://github.com/gradle/gradle-enterprise-api-samples/tree/openapi-generator-issue_inheritance and run build
Will fail with:
Related issues/PRs
Suggest a fix
The straight forward solution would be to
@Override
all inherited fluent setters on the child types, so that they return the correct type.So on
Child
add this method