Feature-Add default and max pagination limit support to prevent large response errors#278
Open
meetghodasara-crest wants to merge 1 commit intoeclecticiq:masterfrom
Conversation
…e errors on manifest and object endpoints
eric-eclecticiq
requested changes
Nov 13, 2025
Contributor
eric-eclecticiq
left a comment
There was a problem hiding this comment.
Thank you for this change, it is indeed a good idea to put a default limit to prevent large response.
However, to merge it, I would ask you to add tests on top of cleaning the format mentioned in the other comment.
| ) | ||
| def manifest_handler(self, api_root_id, collection_id_or_alias): | ||
| filter_params = validate_list_filter_params(request.args, self.persistence.api) | ||
| filter_params["limit"] = self.config.get("max_pagination_limit") if filter_params.get("limit", self.config.get("max_pagination_limit")) > self.config.get("max_pagination_limit") else filter_params.get("limit", self.config.get("default_pagination_limit")) |
Contributor
There was a problem hiding this comment.
As a single line, this is not very readable and probably not compatible with the linter.
Also, it is used multiple times, you may move it to a dedicated method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support of
default_pagination_limitandmax_pagination_limitparameters for manifest and objects get endpoints to avoid errors because of large response size.