File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def find_unique_index(
3333 candidates : list [str ],
3434) -> int :
3535 """
36- Finds the index of a unique entry in a list
36+ Finds the index of a unique entry in a list.
3737 """
3838 counter = 0
3939 matches = []
@@ -52,8 +52,8 @@ def find_unique_index(
5252
5353def render_path (path_template : str , kwargs : dict ) -> str :
5454 """
55- Replace all FastAPI-style {param[:converter]} path parameters
56- with corresponding values from kwargs.
55+ Replace all FastAPI-style {param[:converter]} path parameters with corresponding
56+ values from kwargs.
5757 """
5858
5959 pattern = re .compile (r"{([^}]+)}" ) # Look for all path params
@@ -73,6 +73,11 @@ def url_path_for(
7373 function_name : str , # With logic for partial matches
7474 ** kwargs , # Takes any path param and matches it against curly bracket contents
7575):
76+ """
77+ Utility function that takes the function name and API router name, along with all
78+ necessary path parameters, retrieves the matching URL path template from the route
79+ manifest, and returns a correctly populated instance of the URL path.
80+ """
7681 # Use 'Any' first and slowly reveal types as it is unpacked
7782 route_manifest : dict [str , list [Any ]] = load_route_manifest ()
7883
You can’t perform that action at this time.
0 commit comments