Open ThomasTosik opened 4 years ago
I have the same issue with C# generated code. It ends up trying to inherit from an Enum which is impossible. I feel that the model should not be generated when having a AllOf ref. In my case I end up having a bunch of AllOf... classes all trying to inherit from that same Enum. Which is silly.
Luckily we use NSwag for C# and do not have these issues there.
We have the same problem with swagger-codegen. Classes inheriting from enum.
Is there any progress on this item or a workaround?
Is there any progress on this item or a workaround?
Yes there is a workaround. We just changed our spec from
"lang": {"allOf":[{"$ref":"#/components/schemas/Language"}],"description":"language of incoming query"}
to
"lang": {"$ref": "#/components/schemas/Language"}
Same issue with OpenJDK 8, swagger-codegen-maven-plugin 3.0.23 and this API spec: https://listing-creation.api.autoscout24.com/assets/openapi/spec.yml
Hi,
I'm hitting the same issue, but unable to use the workaround as tie reference is expanded on:
"allOf" : [ {
"$ref" : "#/components/schemas/MetricEventAlertingScope"
}, {
"type" : "object",
"properties" : {
"nameFilter" : {
"$ref" : "#/components/schemas/MetricEventTextFilterMetricEventTextFilterOperatorDto"
}
}
} ]
Any resolution for this
The issue is still present in the latest client code generator 3.0.33.
3.0.51
still has this problem.
3.0.52
still has this problem.
3.0.54
still has this problem.
We are currently facing the exact same problem.
Same problem in my php project
Hi,
we have some issues generating a java client when allof/ref and enums are involved. Sadly we need the allof and we can not omit it since the yaml is given like that.
Tested with swagger cli 3.0.18 and 3.0.21 (on Java 11)
Yaml spec example:
The resulting java model of Level results in an extension of the TraceLevel enum and some overrides.
Erros when building:
Any ideas? Thanks for the help.
Regards