@@ -95,10 +95,12 @@ def extract_endpoint_contracts(self, route_data: Schema__Fast_API__Route
9595 for http_method in (http_methods or [Enum__Http__Method .GET ]): # Create one contract per HTTP method
9696 operation_id = f"{ http_method .value .lower ()} __{ method_name } " # Create operation_id with HTTP method prefix
9797
98- endpoint = Schema__Endpoint__Contract (operation_id = operation_id ,
99- path_pattern = http_path ,
100- method = http_method ,
101- route_method = method_name )
98+ endpoint = Schema__Endpoint__Contract (operation_id = operation_id ,
99+ path_pattern = http_path ,
100+ method = http_method ,
101+ route_method = method_name ,
102+ path_params = route_data .path_params , # Copy extracted params
103+ query_params = route_data .query_params ) # Copy extracted params
102104
103105 endpoint_func = None # Find the actual endpoint function (same for all methods)
104106 for route_obj in self .fast_api .app ().routes :
@@ -109,15 +111,6 @@ def extract_endpoint_contracts(self, route_data: Schema__Fast_API__Route
109111 qualname = route_obj .endpoint .__qualname__ # Extract route class
110112 if '.' in qualname :
111113 endpoint .route_class = qualname .split ('.' )[0 ]
112- #raise Exception("Code below can be deleted since have captured this on the Fast_API__Route__Extrator")
113- # if hasattr(route_obj, 'path_regex'): # Extract path parameters
114- # param_pattern = r'\{(\w+)\}'
115- # path_params = re.findall(param_pattern, http_path)
116- # for param_name in path_params:
117- # endpoint.path_params.append(Schema__Endpoint__Param(name = param_name,
118- # location = Enum__Param__Location.PATH,
119- # param_type = 'str' ))
120- # break
121114
122115 # Enhance with function signature analysis (same for all methods)
123116 if endpoint_func :
0 commit comments