Closed
Description
OpenAPI type null
is converted to Python type Any
, most likely here:
elif schema.type is None or schema.type == "null":
converted_type = pre_type + "Any" + post_type
In Fast API (probably among other sources), Foo | None
is expressed as:
"anyOf": [
{
"$ref": "#/components/schemas/Foo"
},
{
"type": "null"
}
]
because of this issue, we end up with a generated type that uses Union[Foo | Any]
instead of Union[Foo | None]
If this is intentional, I'd love to understand why so I can create a fix that doesn't break some implicit, non-obvious behavior.
Metadata
Metadata
Assignees
Labels
No labels