- Switch to Pydantic which is under continuous development and can
support more types
- Equivalent Pydantic API will try to transform data if possible
- The previous point makes it such that we don't need to explicitly try
to parse each stringified int in app code since Pydantic can do this
- Drop typeguard since it did not handle 3.10+ native typing definitions
Allow default types as acceptable values if not included in typing
hints. A common example of this is:
def test_password_strength(new_password: str, user_data: Sequence = None):
where Optional[Sequence] is implicit since default value is None.
- Run type validations if annotations exist for whitelisted functions
- Run validations only on function calls in presense of frappe.local.request
In action:
```bash
> curl -H 'Content-Type: application/json' 'http://photos:8000/api/method/frappe.handler.download_file' -d '{"file_url": ["!=", "gavin.jpg"]}'
```
Note: This ignores stringified or ForwardRef types. If you want types to
be validated make sure they are not imported under `if TYPE_CHECKING`
blocks