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
Assume that there is a schema ChildClass which inherits via allOf from schema ParentClass with discriminator, and ParentClass has a property x which references a schema that is defined via additionalProperty. Then the overwritten putX builder method in ChildClass is broken.
Add the code at Generator Details to your pom and add the openapi code given above to some valid openapi file /src/main/openapi/test.yaml (I skipped parts of the yaml to keep it as succinct as possible).
The generated class ParentClass contains the following.
public ParentClass putSomeMapItem(String key, String someMapItem) {
if (this.someMap == null) {
this.someMap = new HashMap<>();
}
this.someMap.put(key, someMapItem);
return this;
}
The generated class ChildClass contains the following.
Bug Report Checklist
Description
Assume that there is a schema ChildClass which inherits via allOf from schema ParentClass with discriminator, and ParentClass has a property x which references a schema that is defined via additionalProperty. Then the overwritten putX builder method in ChildClass is broken.
openapi-generator version
6.0.0, 6.0.1-SNAPSHOT
OpenAPI declaration file content or url
Generation Details
Using openapi-generator-maven-plugin with the following configuration
Steps to reproduce
Add the code at Generator Details to your pom and add the openapi code given above to some valid openapi file /src/main/openapi/test.yaml (I skipped parts of the yaml to keep it as succinct as possible).
The generated class ParentClass contains the following.
The generated class ChildClass contains the following.
However, expected is the following.
Related issues/PRs
I did not find any.
Suggest a fix