API Platform version(s) affected: 2.7.*
Description
When using a custom DTO I'm facing this issue
Type error: ApiPlatform\Symfony\Bundle\ArgumentResolver\PayloadArgumentResolver::getExpectedInputClass(): Return value must be of type ?string, array returned (Behat\Testwork\Call\Exception\FatalThrowableError)
I went then to debug what was in $context['input'] and found out that it was containing indeed an array looking like:
['class' => ...., 'name' => ...]
And the key class contains the needed string
How to reproduce
Possible Solution
Returning return $context['input']['class'] ?? $context['resource_class'] in the getExpectedInputClass function from the PayloadArgumentResolver
Additional Context
API Platform version(s) affected: 2.7.*
Description
When using a custom DTO I'm facing this issue
Type error: ApiPlatform\Symfony\Bundle\ArgumentResolver\PayloadArgumentResolver::getExpectedInputClass(): Return value must be of type ?string, array returned (Behat\Testwork\Call\Exception\FatalThrowableError)
I went then to debug what was in
$context['input']and found out that it was containing indeed an array looking like:['class' => ...., 'name' => ...]And the key class contains the needed string
How to reproduce
Possible Solution
Returning
return $context['input']['class'] ?? $context['resource_class']in the getExpectedInputClass function from the PayloadArgumentResolverAdditional Context