-
Hello I'm facing a bug in v2.6 and trying to upgrade to v2.7 to see if it's still exist. However, after replacing Use this code or another one will give the same result. <?php
use ApiPlatform\Metadata\ApiResource;
use Doctrine\ORM\Mapping as ORM;
#[ApiResource]
#[ORM\Entity]
class Entity
{ <?php
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use Doctrine\ORM\Mapping as ORM;
#[ApiResource(operations:[
new Get(),
new GetCollection()
])]
#[ORM\Entity]
class Entity
{ Did I miss something?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Try clearing everything in the cache:
bin/console cache:pool:clear cache.serializer cache.annotations
cache.property_info \
api_platform.cache.route_name_resolver \
api_platform.cache.metadata.resource\
api_platform.cache.metadata.property \
api_platform.cache.metadata.resource_collection
bin/console cache:clear
…On Fri, Jul 29, 2022 at 3:12 AM Asis Pattisahusiwa ***@***.***> wrote:
Hello
I'm facing a bug in v2.6 and trying to upgrade to v2.7 to see if it's
still exist. However, after replacing
ApiPlatform\Core\Annotation\ApiResource with
ApiPlatform\Metadata\ApiResource, I got nothing.
[image: nothing]
<https://user-images.githubusercontent.com/79239132/181702739-c512d84f-0a28-4fe4-a1bb-ddeb5a632031.png>
Use this code or another one will give the same result.
<?php
use ApiPlatform\Metadata\ApiResource;use Doctrine\ORM\Mapping as ORM;
#[ApiResource]
#[ORM\Entity]class Entity
{
<?php
use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use Doctrine\ORM\Mapping as ORM;
#[ApiResource(operations:[
new Get(),
new GetCollection()
])]
#[ORM\Entity]class Entity
{
Did I miss something?
PHP: 8.1
symfony: 6.1
api-platform: 2.7.0-rc.2
—
Reply to this email directly, view it on GitHub
<#4852>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEXIQM6RBKARLZFYRY54QLVWN76BANCNFSM547XZSZA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Make sure you have added |
Beta Was this translation helpful? Give feedback.
-
Thank you @jamesisaac Adding |
Beta Was this translation helpful? Give feedback.
Thank you @jamesisaac
Adding
metadata_backward_compatibility_layer: false
and make sure PHP version is8.1
fix the issue.