-
-
Notifications
You must be signed in to change notification settings - Fork 932
Description
Description
API Platform allows to define filters based on properties in a related object. For example: /teams?club.slug=my-club
. I don't like the fact that my internal properties need to be exposed in this filters. Maybe it's not that problematic in this case, but when filtering on objects 'further away' it can get messy: /matches?pool.competition.season.id=2023&pool.competition.region.slug=north
and I'm exposing more of the data model. It would be really nice to be able to squash that into /matches?season=2023®ion=north
.
Now, the only solution is to create custom filters, but it might be possible to allow adding an alias to the #[ApiFilter]
attribute? However the fact that multiple properties are allowed makes the format of such configuration complicated.