Closed JanC closed 2 years ago
I believe it is due to this part when decoding the schema dictionary. If the schema parses as DataType
we assume it's actually a datatype and don't check further for the allOf
, oneOf
and allOf
.
The open api validation parses such a schema as a oneOf
so it seems those specific types have priority over the type: object
.
Would it make sense to change the parsing below and try first to parse the allOf
, oneOf
and allOf
and only then the DataType
?
This would be a bit of an assumption though that the composite keywords (oneOf, anyOf, allOf) have priority over the object type. I opened a ticket in the springdoc repo which causes such a yaml to be generated: https://github.com/springdoc/springdoc-openapi/issues/1589
closed by PR
Hi, I noticed that the
oneOf
keyword seems to be ignored when the schema contains also thetype: object
:In the below example, the
SingleAnimal
is taken from the spec.yaml but I added thetype: object
.The generated code is a struct
while I would expect it to be a enum