Replies: 3 comments 1 reply
-
I haven't done that before, but as a workaround you probably could make a custom Filter that does nothing when called on the other Operation - it's available in the filterProperty() parameters. Then you'd just forward the call to the filter you really want if it's the right operation? |
Beta Was this translation helpful? Give feedback.
-
It looks like this is actually possible by declaring a service, similar to the example in https://api-platform.com/docs/core/filters/#manual-service-and-attribute-registration services:
'app.filter.book.search':
class: 'ApiPlatform\Doctrine\Orm\Filter\SearchFilter'
arguments: [ '@doctrine', '@api_platform.iri_converter', ~, '@logger', { 'title': ~ } ]
tags: [ 'api_platform.filter' ] new GetCollection(filters: ['app.filter.book.search']), Discussion in #5665 of having an easier syntax |
Beta Was this translation helpful? Give feedback.
-
Thanks to #6244 it'll be possible to declare parameters on an operation-basis in API Platform 3.3. |
Beta Was this translation helpful? Give feedback.
-
Hello
I would like to know if it's possible to give access to certain filters for only one GetCollection route.
Example :
Does anyone have face this kind of needs ?
Thank you for
Beta Was this translation helpful? Give feedback.
All reactions