我使用 API 平台,我在https://api-platform.com/docs/core/filters/#creating-custom-filters 之后定义了一个自定义过滤器
它工作正常,但是每次该应用程序执行特定实体的 GET HTTP 请求(设置过滤器的位置)时,我都需要该过滤器。
我检查了这个代码:
// This function is only used to hook in documentation generators (supported by Swagger and Hydra)
public function getDescription(string $resourceClass): array
{
if (!$this->properties) {
return [];
}
$description = [];
foreach ($this->properties as $property => $strategy) {
$description["similar_$property"] = [
'property' => $property,
'type' => 'string',
'required' => false,
'swagger' => [
'description' => 'Filter using a similar postgres function.',
'name' => $property,
'type' => …Run Code Online (Sandbox Code Playgroud)