Skip to content

Filtering on Nested Properties does not work with QueryParameter #7526

@dlubitz

Description

@dlubitz

API Platform version(s) affected: 4.2.3

Description
Filtering on nested properties does not work, if I use QueryParameter to define the filter:

new GetCollection(
    parameters: [
        'street' => new QueryParameter(
            filter: new PartialSearchFilter(),
            property: 'address.street',
        ),
    ]
)

This results in a SQL error:

[Semantical Error] line 0, col 248 near 'street) LIKE': Error: Class App\\Entity\\Volunteer has no field or association named address.street

If I use the deprecated ApiFilter it works for me:

#[ApiFilter(SearchFilter::class, properties: ['address.street' => 'partial'])]

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