Skip to content

Commit

Permalink
add title to Path
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbenav committed Dec 23, 2024
1 parent a93e2f2 commit 7ae5b1f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fastcrud/endpoint/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def _apply_model_pk(**pkeys: dict[str, type]):
It dynamically changes the endpoint signature and allows to use
multiple primary keys without defining them explicitly.
"""

def wrapper(endpoint):
signature = inspect.signature(endpoint)
parameters = [
Expand All @@ -190,16 +189,16 @@ def wrapper(endpoint):
extra_positional_params.append(
inspect.Parameter(
name=k,
annotation=Annotated[UUID, Path(...)],
kind=inspect.Parameter.POSITIONAL_ONLY
annotation=Annotated[UUID, Path(title=k)],
kind=inspect.Parameter.POSITIONAL_ONLY,
)
)
else:
extra_positional_params.append(
inspect.Parameter(
name=k,
annotation=v,
kind=inspect.Parameter.POSITIONAL_ONLY
annotation=Annotated[v, Path(title=k)],
kind=inspect.Parameter.POSITIONAL_ONLY,
)
)

Expand Down

0 comments on commit 7ae5b1f

Please sign in to comment.