Open cs-nero opened 2 years ago
Any answer?
to have inheritance without using discriminator, please enable REF_AS_PARENT_IN_ALLOF
in openapi normalizer: https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#openapi-normalizer
for allOf and properties in the same level, please enable REFACTOR_ALLOF_WITH_PROPERTIES_ONLY
as well
Description
There is a bug in generating multilevel inheritance. We tested it in several languages, for example typescript or C#. I am using the latest version (6.0.1 JAR).
The generated code looks like the following:
Expected code for the WeatherForecastSub class:
In typescript the code looks like the following:
Expected code for WeatherForecastSub:
OpenAPI declaration file content or url
https://gist.github.com/cs-nero/ed1a23f4d848be5eef37864d4c0b5ab3
Steps to reproduce
Use the following command in your cmd: java -jar .\openapi-generator-cli-6.0.1.jar generate -i swagger.json -g csharp-netcore -o generated --skip-validate-spec
Related issues/PRs
You can see a similar issue here: https://github.com/OpenAPITools/openapi-generator/issues/3058 They say it was fixed, but at least for C# and TypeScript, it's not working.