The problems we solve
-
Doctrine entities exposed as they are: every schema change breaks the API.
-
Serialization groups that are impossible to follow.
-
N+1 queries on every collection.
-
OpenAPI documentation that does not match the actual behavior.
-
Files created by root in the development containers.
What we put in place
-
API resources as DTOs, separate from the entities.
-
Testable providers, processors and mappers.
-
Accurate OpenAPI documentation.
-
A clean Docker and FrankenPHP environment.
Articles
API Platform: a readable ComparisonFilter in OpenAPI
Up to 4.4.2, ComparisonFilter documents each operator as an object, then as a string. Type them with openApi, validate with constraints, avoid the schema trap.
4 min read
API Platform and ObjectMapper: the pitfalls of DTO resources
#[Map] ignored without a source, relations, genid IRIs, a PATCH that erases a field. The ObjectMapper pitfalls with API Platform 4.4 and 5.0, checked in code.
11 min read
FrankenPHP in Docker: no more root-owned files
On Linux, files generated in the FrankenPHP dev container belong to root. A non-root Docker stage, built with the host UID and GID, fixes the problem.
4 min read
API Platform: separate Doctrine entities from API resources
Exposing Doctrine entities ties the database to the API contract. DTO resources, stateOptions and explicit providers keep pagination, filters and extensions.
11 min read