-
-
Notifications
You must be signed in to change notification settings - Fork 950
Closed
Labels
Description
API Platform version(s) affected: 2.7.0
Description
Hi! I was expecting to upgrade a project to ApiPlatform 3. I just launched the api:upgrade-resource in it and saw in my git diff that every filters but the last ones were removed from my resources. It actually removed 200 ApiFilter attributes in my case ...
How to reproduce
symfony new bookshop-api
cd bookshop-api
composer require api-platform/core "^2"
composer require doctrineCreate this entity in src/Entity/:
<?php declare(strict_types=1);
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Doctrine\Orm\Filter\NumericFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
#[Entity]
#[ApiResource]
#[ApiFilter(SearchFilter::class, properties: ['name'])]
#[ApiFilter(NumericFilter::class, properties: ['count'])]
class Test
{
#[Column]
#[GeneratedValue]
#[Id]
public ?int $id = null;
#[Column]
public ?string $name = null;
#[Column]
public int $count = 0;
}You'll have to install phpunit because this package is missing nikic/php-parser dependency.
composer require test
php bin/console api:upThe SearchFilter disappeared.
