-
Notifications
You must be signed in to change notification settings - Fork 1
Extend GET pagination endpoints with max default offset #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend GET pagination endpoints with max default offset #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a configurable maximum offset value for pagination across book and reservation GET endpoints. It adds validation to ensure offset values cannot exceed a configurable maximum while maintaining the default behavior for normal pagination.
- Adds MAX_OFFSET configuration with environment variable support and 5000 default fallback
- Implements offset validation logic in both books and reservations endpoints
- Updates test coverage to validate the new offset range restrictions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| app/config.py | Adds MAX_OFFSET configuration with safe integer parsing and fallback default |
| app/routes/legacy_routes.py | Implements offset validation against MAX_OFFSET in books endpoint |
| app/routes/reservation_routes.py | Implements offset validation against MAX_OFFSET in reservations endpoint |
| tests/test_pagination.py | Adds test coverage for out-of-range offset validation in books endpoint |
| tests/test_reservations.py | Adds test coverage for out-of-range offset validation in reservations endpoint |
| tests/conftest.py | Removes debug print statement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
Trello card: https://trello.com/c/dRDnYYYO
This PR introduces a configurable maximum offset value for pagination across reservation endpoints.
Fixes # (issue number if applicable)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: