Category: api-platform.com

symfony api-platform overwrite JS/CSS of Bundles

I’m trying to customize the appearance of some pages provided by a bundle (api-platform). I can override the twig template by creating a <app>/templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig file, but I’m not sure how I could do the same for css and javascript files….

validate embedded model in api platform

I have this Order model: <?php namespace AppEntity; use ApiPlatformCoreAnnotationApiResource; use SymfonyComponentSerializerAnnotationGroups; use DoctrineORMMapping as ORM; use SymfonyComponentSerializerAnnotationSerializedName; use SymfonyComponentValidatorConstraints as Assert; /** * @ApiResource( * itemOperations={ * “get”={ * “normalization_context”={ * “groups”={“order:view”} * } * }, * “patch”={ *…

How to set normalization groups based on user’s role and request method

I am creating a sandbox app as Api-platform practice and I have the following problem to address: Let’s consider following REST endpoint for user entity: DISCLAIMER in the code examples there are a little more attributes but the whole concept…

I’m getting an error when trying to generate the Api-Platform client app. What steps should I take?

I am running the distribution version of API-Platform. As instructed in https://api-platform.com/docs/distribution/#a-react-progressive-web-app , I’m trying to generate the client app with the command: docker-compose exec client generate-api-platform-client However, I’m getting the error: { api: Api { entrypoint: ‘http://api’, resources: []…

How to configure Varnish in an API-platform project? [Response size limit issue]

Sometimes in my preproduction and production environment, the varnish container send me this error: Error (null) Backend fetch failed Backend fetch failed Guru Meditation: XID: (null) This is due to the size of the body response. So I did implement…

How to make API Platform autodiscovery mechanism for Mercure hub work with Docker image?

I’ve developped a demo project to illustrate a presentation I’m doing about the Mercure protocol, in which I also use API Platform. I had used the autodiscovery mechanism to retrieve the Mercure hub url (API Platform sends a Link header…