configuration-converter-bundle
configuration-converter-bundle copied to clipboard
Custom API filter error
Hello,
Thanks for your bundle, love the idea. I've just started playing with it and it seems great. But I get an error when I try to use it on a Entity with a custom api platform filter.
Example:
<?php
declare(strict_types = 1);
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
use App\Filter\OrSearchFilter;
* @ApiResource(
* collectionOperations={"get"},
* itemOperations={"get"},
* attributes={
* "normalization_context"={"groups"={"job:read"}},
* "denormalization_context"={"groups"={}}
* }
* )
*
* @ApiFilter(OrderFilter::class, properties={"name", "createdAt", "updatedAt"})
* @ApiFilter(OrSearchFilter::class, properties={"search": {
* "name",
* "nafs.code"
* }})
Here, OrSearchFilter is my custom filter.
Error message:
! [NOTE] Converting resource: App\Entity\Job
[ERROR] Notice: Undefined index: App\Filter\OrSearchFilter
Do you have any ideas ?
Thanks!
No idea yet but I did not tested with a custom filter so far,that's cool! I'll look for a solution :)
I tried to write a fix in the train... can you tell me if it work properly now? :)