15
15
PB_TYPE_RPC_SHARED_MEMORY = 'rpc_shared_memory'
16
16
BINDING_REGISTRY = None
17
17
18
+
18
19
def _check_http_input_type_annotation (bind_name : str , pytype : type ) -> bool :
19
20
ext_base = sys .modules .get ('azure.functions.extension.base' )
20
21
if ext_base is not None and ext_base .HttpV2FeatureChecker .http_v2_enabled ():
21
22
return ext_base .RequestTrackerMeta .check_type (pytype )
22
-
23
+
23
24
binding = get_binding (bind_name )
24
25
return binding .check_input_type_annotation (pytype )
25
26
27
+
26
28
def _check_http_output_type_annotation (bind_name : str , pytype : type ) -> bool :
27
29
ext_base = sys .modules .get ('azure.functions.extension.base' )
28
30
if ext_base is not None and ext_base .HttpV2FeatureChecker .http_v2_enabled ():
29
31
return ext_base .ResponseTrackerMeta .check_type (pytype )
30
-
32
+
31
33
binding = get_binding (bind_name )
32
34
return binding .check_output_type_annotation (pytype )
33
35
@@ -40,6 +42,7 @@ def _check_http_output_type_annotation(bind_name: str, pytype: type) -> bool:
40
42
HTTP : _check_http_output_type_annotation
41
43
}
42
44
45
+
43
46
def load_binding_registry () -> None :
44
47
func = sys .modules .get ('azure.functions' )
45
48
@@ -71,15 +74,16 @@ def check_input_type_annotation(bind_name: str, pytype: type) -> bool:
71
74
global INPUT_TYPE_CHECK_OVERRIDE_MAP
72
75
if bind_name in INPUT_TYPE_CHECK_OVERRIDE_MAP :
73
76
return INPUT_TYPE_CHECK_OVERRIDE_MAP [bind_name ](bind_name , pytype )
74
-
77
+
75
78
binding = get_binding (bind_name )
76
79
return binding .check_input_type_annotation (pytype )
77
80
81
+
78
82
def check_output_type_annotation (bind_name : str , pytype : type ) -> bool :
79
83
global OUTPUT_TYPE_CHECK_OVERRIDE_MAP
80
84
if bind_name in OUTPUT_TYPE_CHECK_OVERRIDE_MAP :
81
85
return OUTPUT_TYPE_CHECK_OVERRIDE_MAP [bind_name ](bind_name , pytype )
82
-
86
+
83
87
binding = get_binding (bind_name )
84
88
return binding .check_output_type_annotation (pytype )
85
89
0 commit comments