Skip to content

Commit

Permalink
Add limit to CursorParams.size field (#1119)
Browse files Browse the repository at this point in the history
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
  • Loading branch information
barsikus007 and uriyyo committed Apr 11, 2024
1 parent f7472e7 commit 257b23f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi_pagination/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def encode_cursor(cursor: Optional[Cursor]) -> Optional[str]:

class CursorParams(BaseModel, AbstractParams):
cursor: Optional[str] = Query(None, description="Cursor for the next page")
size: int = Query(50, ge=0, description="Page offset")
size: int = Query(50, ge=0, le=100, description="Page size")

str_cursor: ClassVar[bool] = True

Expand Down

0 comments on commit 257b23f

Please sign in to comment.