Introduce Input/Output DTOs in API Platform 4.3 to decouple the API contract from the Doctrine entity, validate at the boundary, force IRI-only relations (no scalar IDs), and use BackedEnum natively. Covers the new Symfony Object Mapper 4.3 integration (#[Map], ObjectMapperProvider/Processor) for boilerplate-free DTO…
Design API Platform 4.3 error handling around RFC 7807 (application/problem+json, default in 4.x). Covers exceptionToStatus mapping at config / resource / operation level, the 4.3 errors: [DomainException::class] flag on operations (auto-documented in OpenAPI), #[ErrorResource] + ProblemExceptionInterface to turn…
Implement file uploads in API Platform 4.3 with the canonical pattern — VichUploaderBundle (#[Vich\\Uploadable], #[Vich\\UploadableField]), the multipart/form-data format enabled on the Post operation (inputFormats: ['multipart' => …]), a MediaObject resource exposing contentUrl via a custom Normalizer that resolves…
Build API Platform 4.3 filters with the modern parameters + QueryParameter pattern. Use when adding search, sort, range, full-text, or sparse-fieldset filtering to an operation. Covers ExactFilter, PartialSearchFilter (caseSensitive 4.3), IriFilter (nested), UuidFilter (4.3), ComparisonFilter (gt/gte/lt/lte/ne 4.3)…
Expose API Platform 4.3 operations as Model Context Protocol tools for AI agents (Claude, ChatGPT, etc.) via the new api-platform/mcp + symfony/mcp-bundle components — marked @experimental upstream. Covers #[McpTool] standalone (name, description, processor, optional validate: true), the mcp: keyword on #[ApiResource]…
Use API Platform 4.3's new #[AsResourceMutator(resourceClass: …)] and #[AsOperationMutator(operationName: …)] to mutate resource/operation metadata at build time — zero runtime cost. Implement ResourceMutatorInterface::invoke(ApiResource $resource): ApiResource to e.g. prefix every operation's routePrefix, or…
Customize API Platform 4.3 OpenAPI / Hydra / Scalar documentation — the openapi: new \\ApiPlatform\\OpenApi\\Model\\Operation(...) attribute (with Info, Parameter, RequestBody, Response, Server, Contact, License), decorating apiplatform.openapi.factory to inject x-logo and global metadata, the openapi: false flag to…
Configure API Platform 4.3 pagination — default page size (30 items in 4.x, not 20), hydraprefix: false shape (member / totalItems / view / next keys, no hydra: prefix), partial pagination (paginationPartial: true) to skip the COUNT on large tables, cursor-based pagination via paginationViaCursor paired with UUID v7 /…
Tune API Platform 4.3 + Doctrine + Symfony performance — recognize the 4.x default trap eagerloading.forceeager: true (often counter-productive, switch to false + targeted join fetches), use EXTRALAZY for large collections, project DTOs in DQL (NEW App\\Dto\\PostListItem(...)) to avoid hydrating full entities for list…
Build resilience patterns around an API Platform 4.3 app — Circuit Breaker (Closed → Open → Half-Open) on external dependencies (ERP, payment, search), cached fallback on Open state with a notice.type: degradedmode marker in the response, asynchronous writes for slow upstreams (HTTP 202 + status: pendingerpprocessing…
Master API Platform 4.3 serialization — design groups (entity:operation convention, read ≠ write), force IRI on relations with #[ApiProperty(readableLink: false, writableLink: false)], prevent circular references with MaxDepth, use BackedEnum natively, apply #[Context] for per-property formats, install a Context…
Write or evolve an API Platform 4.3 State Processor — turn a DTO Input into a persistence effect (Doctrine + dispatch). Covers the Autowire-based decoration of apiplatform.doctrine.orm.state.persistprocessor / removeprocessor, the DeleteOperationInterface discriminator, the native Messenger modes (messenger: 'input'…
Write or evolve an API Platform 4.3 State Provider — transform a data source (Doctrine, external API, cache) into the API representation. Covers the modern Autowire-based decoration of apiplatform.doctrine.orm.state.itemprovider / collectionprovider, the CollectionOperationInterface discriminator, header-versioned…
Implement the canonical API Platform 4.3 + Symfony 7.4+ User entity — User implements UserInterface, PasswordAuthenticatedUserInterface, #[UniqueEntity('email')], a transient $plainPassword validated only on user:create, the persisted hashed $password excluded from every serialization group, a UserPasswordHasher State…
Plan and implement API Platform 4.3 versioning — URI versioning (/v1/, /v2/), separate Output DTOs per version (with dedicated Providers), header-based versioning (X-API-Version resolved in a versioned Provider), additive group-based versioning for minor changes, deprecation with the 4.x attribute (deprecationReason…
Pre-architecture brainstorming for an API Platform feature — when the story isn't yet stable enough to feed /architect. Explores requirements, identifies invariants, considers alternatives, surfaces unknowns, defines the smallest valuable slice. Output: a refined story description ready for /architect or…
Refactor fat controllers into thin orchestrators — extract business logic to services, use #[MapRequestPayload] / #[MapQueryString] for input DTOs, dispatch to handlers via MessageBusInterface, #[IsGranted] attributes for authz, slim action methods to 5-10 lines, separate Form DTOs from entities. For API Platform…