Skip to content
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 consistency for the maximum_items_per_page option. #3086

Closed
wants to merge 1 commit into from
Closed

Add consistency for the maximum_items_per_page option. #3086

wants to merge 1 commit into from

Conversation

bpolaszek
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #3050
License MIT
Doc PR api-platform/docs#874

This PR introduces a pagination_maximum_items_per_page as the new source of truth for hard-limiting the number of items in a resultset.

Former attribute maximum_items_per_page still works as a fallback with a deprecation notice when used.

$maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_maximum_items_per_page', $maxItemsPerPage, true);

if (null !== $maxItemsPerPage) {
$itemPerPageParameter['schema']['maximum'] = $maxItemsPerPage;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a feature, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I thought at first... but #3050 (comment)

@soyuka
Copy link
Member

soyuka commented Sep 23, 2019

Should we merge this on 2.5? Some ci are failing?

@bpolaszek
Copy link
Contributor Author

@soyuka Checked with @dunglas, I shouldn't have rebased on 2.4.
Let this PR apart for the moment, I'll make another one based on 2.5 this morning.

@bpolaszek
Copy link
Contributor Author

See #3088.

@bpolaszek bpolaszek closed this Sep 24, 2019
@bpolaszek bpolaszek deleted the maximumItemsPerPage-2.4 branch October 1, 2019 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants