Category: api

Api-platform (Symfony) : Add data to Url

I’ve encountered a problem with Api-platform, some code that was already there when I started my job is making me angry. Here it is : /** * Class PhysicalProfile. * * @ORMTable(name="front_user_physical_profile") * @ORMEntity(repositoryClass="AppRepositoryPhysicalProfileRepository") * @ApiResource( * denormalizationContext={"groups"={"update"}}, * collectionOperations={"create"={…

Undefined method ‘encodePassword’. – error in Apiplateform security encoder undefined

I have a problem in my symfony security api in the service PasswordService. It can’t find the encoder I can’t guess what should I do. This is my security.yaaml file: This is my code: <?php namespace AppServices; use SymfonyComponentSecurityCoreEncoderUserPasswordEncoderInterface; class…

How to implement custom item get endpoint with filtering in api platform?

I am working on a symfony/api platform app that allows users to track sports matches. My entities look like this (shortened for brevity): User.php class User implements UserInterface { // … /** * @ORMOneToMany(targetEntity=MatchPlayer::class, mappedBy="user") */ private $matches; // ……

Symfony 4.4 FOS user-bundle api/auth/login Call to a member function findOneBy() on null

I’m using symfony 4.4 via docker and installed FOS user bundle some time ago. Everything was working fine but recently while trying to login, i keep getting the error Call to a member function findOneBy() on null. The full trace…

Sylius – Shop Api – when shop API runs error occurred Unable to find template ""

Im trying to use the sylius shop-api plugging and following thi DOC as API doc. I successfully installed the plugging and I tried to run a GET method as first time ( http://localhost:8000/shop-api/product-latest?locale=en_US&limit=10 ) It’s showing a error as bellow…