mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 07:50:32 +00:00
Added model validation to remove UNSET before field validation (#1233)
* Add model validation to remove UNSET before field validation Updated aiogram/types/base.py to include a model validator which removes any 'UNSET' before field validation. This change was necessary to correctly handle `parse_mode` where 'UNSET' is used as a sentinel value. Without the removal of 'UNSET', it would create issues when passed to model initialization from `Bot.method_name`. 'UNSET' was also added to typing. Tiny documentation fix was made. * Added changelog
This commit is contained in:
parent
42570fb747
commit
98780dfb49
2 changed files with 20 additions and 3 deletions
4
CHANGES/1233.bugfix.rst
Normal file
4
CHANGES/1233.bugfix.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Added model validation to remove UNSET before field validation.
|
||||
This change was necessary to correctly handle parse_mode where 'UNSET' is used as a sentinel value.
|
||||
Without the removal of 'UNSET', it would create issues when passed to model initialization from Bot.method_name.
|
||||
'UNSET' was also added to typing.
|
||||
Loading…
Add table
Add a link
Reference in a new issue