api-platform / api-platform/core

`ApiFilter` does not respect `SerializerName`

未關閉
#5,980 3 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
PHP
星號
2.6k
分支
980
平均合併
2 天 4 小時
30 天內合併 PR
49

描述

**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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。