Skip to content

Conversation

vincentchalamon
Copy link
Contributor

Q A
Branch? 4.1
Tickets N/A
License MIT
Doc PR N/A

Considering the following configuration:

new GetCollection( // ... parameters: [ 'archivedOnly' => new QueryParameter( key: 'archivedOnly', schema: ['type' => 'boolean'], required: true, openApi: new Model\Parameter( name: 'archivedOnly', in: 'query', required: true, ), ), ], ),

The current code only supports array or string types, then fallback to an array of strings (cf. ParameterResourceMetadataCollectionFactory line 160), which seems then considered to an iterable by the validator (All validator is applied, which expects an array as value), leading to the following error:

Symfony\Component\HttpClient\Exception\ClientException: An error occurred

archivedOnly: This value should be of type iterable.

Supporting boolean type here fixes this issue.

@vincentchalamon vincentchalamon requested a review from soyuka June 17, 2025 16:04
@soyuka soyuka merged commit dba9737 into api-platform:4.1 Jun 19, 2025
110 of 111 checks passed
@soyuka
Copy link
Member

soyuka commented Jun 19, 2025

thanks !

@vincentchalamon vincentchalamon deleted the fix/parameter-type-detection branch June 19, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants