#901 Fixed false-positive coercing of Union types in API methods (#912)

* #901 Fixed false-positive coercing of Union types in API methods

* Added default value for force_reply
This commit is contained in:
Alex Root Junior 2022-05-14 17:27:36 +03:00 committed by GitHub
parent 6ad242399b
commit 824b43c436
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

View file

@ -46,6 +46,7 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[TelegramType]):
allow_population_by_field_name = True
arbitrary_types_allowed = True
orm_mode = True
smart_union = True # https://github.com/aiogram/aiogram/issues/901
@root_validator(pre=True)
def remove_unset(cls, values: Dict[str, Any]) -> Dict[str, Any]: