I got tired of describing the same request 3 times in Symfony
Source: Dev.to
The Problem
When building Symfony APIs, I kept duplicating the same request contract:
- Validation rules in a DTO
- OpenAPI schema (often separately)
- Mapping / glue code around it
After enough endpoints, the API layer started feeling heavier than the business logic.
A Tiny Example
// (original example code was omitted)
- Documentation site:
Discussion
What part do you duplicate the most in Symfony APIs: validation, OpenAPI, or mapping?