|
1 | | -import dataclasses |
2 | 1 | import collections |
| 2 | +import dataclasses |
3 | 3 | import inspect |
4 | 4 | import re |
5 | | -import sys |
6 | 5 | from contextlib import AsyncExitStack, contextmanager |
7 | 6 | from copy import copy, deepcopy |
8 | 7 | from dataclasses import dataclass |
|
23 | 22 | ) |
24 | 23 |
|
25 | 24 | import anyio |
26 | | -from fastapi import params |
| 25 | +from fastapi import params, temp_pydantic_v1_params |
27 | 26 | from fastapi._compat import ( |
28 | 27 | PYDANTIC_V2, |
29 | 28 | ModelField, |
|
81 | 80 | from starlette.websockets import WebSocket |
82 | 81 | from typing_extensions import Annotated, Literal, get_args, get_origin |
83 | 82 |
|
84 | | -from .. import temp_pydantic_v1_params |
85 | | - |
86 | 83 | multipart_not_installed_error = ( |
87 | 84 | 'Form data requires "python-multipart" to be installed. \n' |
88 | 85 | 'You can install "python-multipart" with: \n\n' |
@@ -754,20 +751,24 @@ def _default() -> Dict[str, Any]: |
754 | 751 |
|
755 | 752 | @staticmethod |
756 | 753 | def decode( |
757 | | - field_info: params.Param, |
| 754 | + field_info: Union[params.Param, temp_pydantic_v1_params.Param], |
758 | 755 | received_params: Union[Mapping[str, Any], QueryParams, Headers], |
759 | 756 | field: ModelField, |
760 | 757 | ) -> Dict[str, Any]: |
761 | 758 | fn: Callable[ |
762 | | - [params.Param, Union[Mapping[str, Any], QueryParams, Headers], ModelField], |
| 759 | + [ |
| 760 | + Union[params.Param, temp_pydantic_v1_params.Param], |
| 761 | + Union[Mapping[str, Any], QueryParams, Headers], |
| 762 | + ModelField, |
| 763 | + ], |
763 | 764 | Dict[str, Any], |
764 | 765 | ] |
765 | 766 | fn = getattr(ParameterCodec, f"decode_{field_info.style}") |
766 | 767 | return fn(field_info, received_params, field) |
767 | 768 |
|
768 | 769 | @staticmethod |
769 | 770 | def decode_deepObject( |
770 | | - field_info: params.Param, |
| 771 | + field_info: Union[params.Param, temp_pydantic_v1_params.Param], |
771 | 772 | received_params: Union[Mapping[str, Any], QueryParams, Headers], |
772 | 773 | field: ModelField, |
773 | 774 | ) -> Dict[str, Any]: |
|
0 commit comments