openapi-generator-dart
openapi-generator-dart copied to clipboard
AnyOf doesn't code generate correctly.
I have a OpenAPI spec that includes the following component that confuses the openapi_generator to no end:
"ValidationError": {
"title": "ValidationError",
"required": [
"loc",
"msg",
"type"
],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
}
},
"msg": {
"title": "Message",
"type": "string"
},
"type": {
"title": "Error Type",
"type": "string"
}
}
}
This winds up with a AnyOfstringinteger which isn't generated.
The source of this appears to be: https://github.com/tiangolo/fastapi/pull/4806
I have the same problem. Any idea on how to fix this? I can do it manually as a temporary fix but I would like to have an example of how the code should look like.
To me it looks like the OpenAPI Dart generator doesn't support anyOf: https://openapi-generator.tech/docs/generators/dart#schema-support-feature
As such, this is not an issue with this repo, but rather https://github.com/OpenAPITools/openapi-generator