Closed leonard84 closed 1 year ago
@leonard84 I believe it might be already reported
https://github.com/OpenAPITools/openapi-generator/issues/13150 https://github.com/OpenAPITools/openapi-generator/issues/13682
and opened PR: https://github.com/OpenAPITools/openapi-generator/pull/13815
Bug Report Checklist
Description
The generator adds subtypes where they don't belong and doesn't respect the mapping.
similarly the static mapper is wrong:
Pet:
Cat:
This causes broken serialization as can be seen here https://github.com/gradle/gradle-enterprise-api-samples/blob/de89e6b8d702d1e08df1f09fea419e1c5e87d543/src/test/java/Test.java#L36-L40
openapi-generator version
6.4.0
OpenAPI declaration file content or url
Generation Details
https://github.com/gradle/gradle-enterprise-api-samples/blob/de89e6b8d702d1e08df1f09fea419e1c5e87d543/build.gradle.kts#L36-L58
Steps to reproduce
Checkout https://github.com/gradle/gradle-enterprise-api-samples/tree/openapi-generator-issue_allOf_Subtypes Run
./gradlew :test
Related issues/PRs
14910 only mentions extraneous typeinfo on subclasses, but not the wrong mapping.
Suggest a fix
Remove the typeinfo on subclasses and filter out the duplicate type info for mappings.