fix(jsonapi): add support for pagination array parameter name
| 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.
@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.
@soyuka @dunglas any news around this PR ?
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.