I got tired of describing the same request 3 times in Symfony

Published: (May 29, 2026 at 05:43 AM EDT)
1 min read
Source: Dev.to

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?

0 views
Back to Blog

Related posts

Read more »