1212
1313
1414class ResolverResult (t .NamedTuple ):
15+ """
16+ A named tuple containing the resolved value, any errors, and the raw data.
17+ """
18+
1519 data : t .Optional [t .Any ]
1620 errors : t .Optional [t .List [t .Dict [str , t .Any ]]]
1721 raw_data : t .Dict [str , t .Any ]
@@ -27,12 +31,29 @@ class IRouteParameterResolver(ABC, metaclass=ABCMeta):
2731 @abstractmethod
2832 @t .no_type_check
2933 async def resolve (self , * args : t .Any , ** kwargs : t .Any ) -> ResolverResult :
30- """Resolve handle"""
34+ """
35+ Resolves the value of the parameter during request processing.
36+
37+ Args:
38+ *args: Additional positional arguments.
39+ **kwargs: Additional keyword arguments.
40+
41+ Returns:
42+ `ResolverResult`: A named tuple containing the resolved value, any errors, and the raw data.
43+ """
3144
3245 @abstractmethod
3346 @t .no_type_check
3447 def create_raw_data (self , data : t .Any ) -> t .Dict :
35- """Essential for debugging"""
48+ """
49+ Creates the raw data for the parameter.
50+
51+ Args:
52+ data: The resolved value of the parameter.
53+
54+ Returns:
55+ `dict`: A dictionary containing the raw data.
56+ """
3657
3758
3859class BaseRouteParameterResolver (IRouteParameterResolver , ABC ):
@@ -42,10 +63,12 @@ def __init__(self, model_field: ModelField, *args: t.Any, **kwargs: t.Any) -> No
4263 )
4364
4465 def create_raw_data (self , data : t .Any ) -> t .Dict :
45- """Essential for debugging"""
4666 return {self .model_field .name : data }
4767
4868 def assert_field_info (self ) -> None :
69+ """
70+ Asserts that the field info is of the correct type.
71+ """
4972 from .. import params
5073
5174 assert isinstance (
@@ -69,4 +92,13 @@ async def resolve(self, *args: t.Any, **kwargs: t.Any) -> ResolverResult:
6992 @abstractmethod
7093 @t .no_type_check
7194 async def resolve_handle (self , * args : t .Any , ** kwargs : t .Any ) -> ResolverResult :
72- """resolver action"""
95+ """
96+ Resolves the value of the parameter during request processing.
97+
98+ Args:
99+ *args: Additional positional arguments.
100+ **kwargs: Additional keyword arguments.
101+
102+ Returns:
103+ `ResolverResult`: A named tuple containing the resolved value, any errors, and the raw data.
104+ """
0 commit comments