Skip to content
Advertisement

Entity not visible in swagger UI api platform

I use Api Platform & Symfony (5.4) + php 7.2.5

I created an Entity by myself, I just added one file in /src/Entity and it’s not working.

I refresh, I cleared cache, I adde @ApiResource… But the Entity is not visible in the doc page in API Platform.

Have you an idea where the error is ? Thanks !

Here is the code I used for the new entity :

JavaScript

Advertisement

Answer

I think you should delete your Entity and remake it with the cmd :

JavaScript

that will make a Rewiew.php files in Entity folders with getter and setter and correct annotations examples :

JavaScript

and repository file etc.. dont forget use :

php bin/console make:migration

and:

php bin/console doctrine:migrations:migrate

for update your database. And dont forget to use apiplatform annotation. I think actually the bundle can’t know how use your entity because of missing information

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement