Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mburysek committed Dec 10, 2024
1 parent abeab91 commit 381cdf7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions asab/api/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def parse_route_data(self, route) -> dict:
if docstring_yaml is not None:
route_data.update(docstring_yaml)

for path_parameter in extract_path_parameters(route):
# Find all path parameters, add them if not specified in docstring.
for path_parameter in get_path_parameters(route):
if path_parameter.get("name") is not None:
if path_parameter["name"] not in [r["name"] for r in route_data["parameters"]]:
route_data["parameters"].append(path_parameter)
Expand Down Expand Up @@ -297,9 +298,9 @@ def get_docstring_description(docstring: typing.Optional[str]) -> str:
return description


def extract_path_parameters(route) -> list:
def get_path_parameters(route) -> list:
"""
Take a single route and return its parameters.
Return path parameters of a route.
"""
parameters: list = []
route_info = route.get_info()
Expand Down

0 comments on commit 381cdf7

Please sign in to comment.