-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
Description
API Platform version(s) affected: 3.2.7
Description
We had an issue poping from nowhere saying the following : "ApiPlatform\Doctrine\Orm\Filter\AbstractFilter::denormalizePropertyName(): Return value must be of type string, int returned". After some investigations : we fond out that the denormalizePropertyName
gets a string|int
parameter, returns a string
, but returns the parameter, which can be an int
, as we can see here :
protected function denormalizePropertyName(string|int $property): string
{
if (!$this->nameConverter instanceof NameConverterInterface) {
return $property;
}
return implode('.', array_map($this->nameConverter->denormalize(...), explode('.', (string) $property)));
}
How to reproduce
Sadly I don't know how it happened yet, thus I'm not able to reproduce it.
Possible Solution
Either :
- Change return type to
string|int
- Do not accept
int
as a valid parameter
Additional context
ApiPlatform\Doctrine\Orm\Filter\AbstractFilter::denormalizePropertyName at line 83