Skip to content

Commit

Permalink
Fix issue with incorrect body schema (#1299)
Browse files Browse the repository at this point in the history
  • Loading branch information
uriyyo committed Sep 24, 2024
1 parent 2959130 commit 774165c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fastapi_pagination/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,12 @@ async def _page_ctx_dependency(
def _bet_body_field(route: APIRoute) -> Optional[Any]:
try:
# starting from fastapi 0.113.0 get_body_field changed its signature
return get_body_field(flat_dependant=route.dependant, name=route.unique_id, embed_body_fields=True)
except TypeError:
return get_body_field(
flat_dependant=route.dependant,
name=route.unique_id,
embed_body_fields=route._embed_body_fields,
)
except (TypeError, AttributeError):
return get_body_field(dependant=route.dependant, name=route.unique_id)


Expand Down

0 comments on commit 774165c

Please sign in to comment.