diff --git a/fastapi_code_generator/parser.py b/fastapi_code_generator/parser.py index 30980da..224cfff 100644 --- a/fastapi_code_generator/parser.py +++ b/fastapi_code_generator/parser.py @@ -83,7 +83,8 @@ class Operation(CachedPropertyModel): @cached_property def root_path(self) -> UsefulStr: - return UsefulStr(self.path.split("/")[1:]) + paths = self.path.split("/") + return UsefulStr(paths[1] if len(paths) > 1 else '') @cached_property def snake_case_path(self) -> str: @@ -309,6 +310,7 @@ def inject_path_and_type_to_operation(cls, values: Dict[str, Any]) -> Any: if (v := values.get(o)) }, path=path, + parameters=values.get('parameters', []), ) @root_validator