api-platform / api-platform/core

`ApiFilter` does not respect `SerializerName`

Open
#5,980 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
2.6k
Forks
980
Avg merge
2d 4h
Merged PRs (30d)
49

Description

**API Platform version(s) affected**: v3.1.18

**Description**
The following will not work:

```php
#[ApiResource(
operations: [
new GetCollection(),
],
)]

#[ApiFilter(DateFilter::class, properties: [
'date',
])]
class Foo
{
#[SerializedName('date')]
public \DateTimeInterface $reallyBadlyNamedDateForLegacyReasons;
}
```

beacuse the filters do not consider the `SerializerName` of the attribute we want to filter on

**How to reproduce**

**Possible Solution**
1. Some code here which takes into account the `SerializedName` here?
https://github.com/api-platform/core/blob/main/src/Doctrine/Orm/Filter/AbstractFilter.php#L89

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.