Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(doctrine): use parameter.property as filter value key #6572

Merged

Conversation

nikophil
Copy link
Contributor

@nikophil nikophil commented Sep 2, 2024

Q A
Branch? 3.3
License MIT

This small change uses Parameter::$property instead of Parameter::$key in filters.
This would allow for "alias" parameters to work out of the box.

Given this api resource:

#[GetCollection(
    parameters: [
        'fooAlias' => new QueryParameter(filter: 'some_filter', property: 'foo'),
    ]
)]
class MyClass
{
    #[ORM\Column()]
    public string $foo = '';
}

such calls would search on foo property: /my-classs?fooAlias=bar

@soyuka soyuka merged commit ef0ee64 into api-platform:3.3 Sep 2, 2024
74 of 77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants