I upgrade:
Symfony : 5.3 to 5.4
APIPlatform/core : 2.6 to 2.7
PHP: 7.4 to 8.0
Then i changed the annotation from old one to new one (Annotation php 7.4 to Attributes 8.0)
But i don’t receive the User entity in /api/docs.
Before that, i got this error:
NB: old annotation works fine
User.php
use ApiPlatformMetadataApiResource;
use ApiPlatformMetadataDelete;
use ApiPlatformMetadataGet;
use ApiPlatformMetadataGetCollection;
#[ApiResource(
operations: [
new GetCollection(security: 'is_granted("ROLE_USER")'),
new Get()
],
)]
#[ORMEntity(repositoryClass: UserRepository::class)]
#[ApiFilter(SearchFilter::class, properties: ['email' => 'ipartial', 'username' => 'ipartial'])]
#[UniqueEntity(fields: ['username'])]
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
i tried upgrade to PHP 8.1 and not working also.