Skip to content

Commit

Permalink
Model - discriminator property can be aliased
Browse files Browse the repository at this point in the history
  • Loading branch information
commonism committed Aug 8, 2023
1 parent b0d147e commit 329a2a3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions aiopenapi3/model.py
Expand Up @@ -166,9 +166,7 @@ def from_schema_type(
for i in schema.anyOf
)
if schema.discriminator and schema.discriminator.mapping:
classinfo.root = Annotated[
Union[t], Field(discriminator=Model.nameof(schema.discriminator.propertyName))
]
classinfo.root = Annotated[Union[t], Field(discriminator=schema.discriminator.propertyName)]
else:
classinfo.root = Union[t]
elif hasattr(schema, "oneOf") and schema.oneOf:
Expand Down

0 comments on commit 329a2a3

Please sign in to comment.