API Platform version(s) affected: 4.3.4
Description
When enabling defaults.strictQueryParameterValidation in global config:
#config/packages/api-platform.yaml
api_platform:
defaults:
strictQueryParameterValidation: true
parameters:
# Some of our own global parameters, not sure if this might be related that we also define more params
ApiPlatform\Metadata\QueryParameter:
key: '_lang'
required: false
description: '2 letter language code, for example EN. By default, the primary language is used.'
It does not automatically whitelist the pagination query parameters for GetCollection operations. The openapi docs do include the pagination parameters, so they are definitely added to the operation, but for the parameter validation, they are not included.
How to reproduce
Enable strictQueryParameterValidation, then try to do a GetCollection operation with pagination parameters. Result is 400:
"title": "Parameter not supported",
"detail": "Parameter \"page\" not supported",
"description": "Parameter \"page\" not supported"
Possible Solution
Add the pagination parameters to the operation before query parameter validation.
#8544
Additional Context
API Platform version(s) affected: 4.3.4
Description
When enabling
defaults.strictQueryParameterValidationin global config:It does not automatically whitelist the pagination query parameters for
GetCollectionoperations. The openapi docs do include the pagination parameters, so they are definitely added to the operation, but for the parameter validation, they are not included.How to reproduce
Enable
strictQueryParameterValidation, then try to do aGetCollectionoperation with pagination parameters. Result is 400:Possible Solution
Add the pagination parameters to the operation before query parameter validation.
#8544
Additional Context