Skip to content

Commit

Permalink
docs: add docstring to _resolve_http_code
Browse files Browse the repository at this point in the history
  • Loading branch information
zumuta committed Nov 16, 2024
1 parent b6b461a commit 4f23ac1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/griffe_fastapi/_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _search_decorator(decorators: list[Decorator]) -> Decorator | None:


def _resolve_http_code(func, http_code: str | ExprAttribute):
"""When http code is an attribute, try to get the value."""
if isinstance(http_code, ExprAttribute):
if http_code.canonical_path.startswith("fastapi.status."):
return http_code.last.name.split("_")[1]
Expand Down

0 comments on commit 4f23ac1

Please sign in to comment.