-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add limit to CursorParams.size field #1119
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1119 +/- ##
==========================================
+ Coverage 93.26% 94.11% +0.84%
==========================================
Files 35 37 +2
Lines 1040 1275 +235
==========================================
+ Hits 970 1200 +230
- Misses 70 75 +5 ☔ View full report in Codecov by Sentry. |
Yay! 🎉 |
Hi! While I understand the wish, this completely broke multiple parts of our software, as the APIs now send out an HTTPValidationError when requesting more than 100 records at a time (which is perfectly sensible for us). I was not expecting a breaking change in a patch release! Is there a way we can make this easily overridable? Because from what we can tell we are going to have to write a custom Page to allow for bigger limits. Which seems a bit overkill for such a small setting. |
@marjoleinveenendaal I'm so sorry to hear that. It's always such a bad situation when I break someone code( You can customize from fastapi_pagination.cursor import CursorPage as BaseCursorPage
from fastapi_pagination.customization import UseParamsFields, CustomizedPage
CursorPage = CustomizedPage[
BaseCursorPage,
UseParamsFields(
size=Query(50, ge=0),
),
] |
Thanks! This is less complex than we thought, we will implement it like this! |
Great, please, let me know if you will have any kind of issues 🙏 |
Resolves #1116