Skip to content

Wrong usage of Doctrine ORM SearchFilter in new filters documentation #2196

@fbourigault

Description

@fbourigault

In https://api-platform.com/docs/core/filters/#filtering-multiple-properties-with-property, there is an example use of ApiPlatform\Doctrine\Orm\Filter\SearchFilter in a QueryParameter:

#[ApiResource(operations: [
    new GetCollection(
        parameters: [
            'search[:property]' => new QueryParameter(
                filter: new SearchFilter(properties: ['title' => 'partial', 'description' => 'partial'])
            )
        ]
    )
])]

This is not possible as in 4.1 (also in 4.2) because SearchFilter has the ManagerRegistry $managerRegistry and IriConverterInterface $iriConverter as required constructor arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions