You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
My problem is that every change that I got in annotations, I need to input cache:clear or cache:pool:clear to see my changes i.e (Adding serialization groups, adding attributes to @ApiResource annotation etc.).
I'm using PHP 8.3. Dev environment of course.
Steps to reproduce
Add ApiPlatform\Core\Annotation\ApiResource to any custom entity. Example code below:
<?php
declare(strict_types=1);
namespace App\Entity\Menu;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Wemea\SyliusMenuPlugin\Entity\Menu as BaseMenu;
#[ApiResource(
routePrefix: '/shop',
description: 'This resource is used to manage frontend Menus',
collectionOperations: [
'get'
],
itemOperations: [
'post'
]
)]
#[ORM\Entity]
#[ORM\Table(name: 'wemea_menu')]
class Menu extends BaseMenu
Possible Solution
use metadata_backward_compatibility_layer: false on api_platform.yaml as someone suggested, but unfortunately this will break the configuration with the following error:
The service "api_platform.metadata.resource.metadata_factory.yaml" has a dependency on a non-existent service "api_platform.metadata.extracto
r.yaml". Did you mean one of these: "api_platform.metadata.extractor.xml.legacy", "api_platform.metadata.extractor.yaml.legacy", "api_platfor
m.metadata.resource_extractor.xml", "api_platform.metadata.property_extractor.xml", "api_platform.metadata.resource_extractor.yaml", "api_pla
tform.metadata.property_extractor.yaml"?
The text was updated successfully, but these errors were encountered:
This problem definitely seems to be caused more by the API Platform or Symfony. From the perspective of Sylius, we use APIP and nothing on our side changes the way configurations are cached.
As for the flag you mentioned, in Sylius 1.x it has to be enabled because of the way resources are configured. In version 2.0 only, we will use the new metadata from API Platform, perhaps the behaviour will be different there.
Sylius version affected: 1.13.0
Description
My problem is that every change that I got in annotations, I need to input cache:clear or cache:pool:clear to see my changes i.e (Adding serialization groups, adding attributes to @ApiResource annotation etc.).
I'm using PHP 8.3. Dev environment of course.
Steps to reproduce
Add
ApiPlatform\Core\Annotation\ApiResource
to any custom entity. Example code below:Possible Solution
use
metadata_backward_compatibility_layer: false
onapi_platform.yaml
as someone suggested, but unfortunately this will break the configuration with the following error:The text was updated successfully, but these errors were encountered: