core icon indicating copy to clipboard operation
core copied to clipboard

fix(jsonapi): add support for pagination array parameter name

Open seb37800 opened this issue 1 year ago • 2 comments

Q A
Branch? 3.2
Tickets
License MIT
Doc PR

This bugfix is related to the jsonapi spec & the handling of pagination parameters in the pagination service. Following the JSON:API specification around pagination => https://jsonapi.org/format/#fetching-pagination When i setup api_platform.yaml with

api_platform:
    collection:
        pagination:
            page_parameter_name: page[number]
            items_per_page_parameter_name: page[size]

And use ApiPlatform\State\Pagination\Pagination in a custom provider, we can't retrieve the page[number] & page[size] in $context['filters'].

Thanks to @GregoireHebert for the help.

In addition this fix that let us specify array in pagination parameter names will fix the generated documentation.

seb37800 avatar Apr 16 '24 09:04 seb37800

@soyuka If you've time to check the unit test to better understand the use case. I don't find a way to make a behat test due to an unknown factor on how to change the default api platform config for this behat test only.

seb37800 avatar May 23 '24 06:05 seb37800

@soyuka @dunglas any news around this PR ?

seb37800 avatar Jul 09 '24 07:07 seb37800

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 07 '24 10:09 stale[bot]