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 Jul 30, 2023
1 parent 9ff819f commit 58c6aea
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)]

Check warning on line 169 in aiopenapi3/model.py

View check run for this annotation

Codecov / codecov/patch

aiopenapi3/model.py#L169

Added line #L169 was not covered by tests
else:
classinfo.root = Union[t]
elif hasattr(schema, "oneOf") and schema.oneOf:
Expand Down

0 comments on commit 58c6aea

Please sign in to comment.