Relative Content

Tag Archive for phpsymfonyapi-platform.comsymfony7api-platform

Why testing API Platform PUT and PATCH requests does not work but API works with same operations with custom components with DTO

I use Doctrine objects in database that are mapped to DTOs by services with a getComponentDtoFromEntity($component) method to expose them on API Platform 3.2 on Symfony 7.1 and PHP 8.3. Each DTO has a route with needed HTTP verbs which allows me to work only with data I need, have multiple endpoints using the same entity (with different DTO), having composite DTOs (a mix of multiples entities) and never expose directly my entities.
I created some DTO directly linked to API Platform, for example :