API Platform DTO Generator

0•

Automates the creation of Input/Output Data Transfer Objects (DTOs), State Providers, and Processors for API Platform resources.

This skill streamlines the implementation of the DTO pattern in API Platform applications by generating boilerplate code for data transfer, mapping, and state management. It handles the creation of immutable Output DTOs for data exposure and validated Input DTOs for data ingestion. By automatically scaffolding the necessary Symfony State Providers and Processors, it helps developers decouple their public API contracts from internal database entities, facilitating better API versioning and cleaner domain logic.

主要功能

01Creates validated Input DTOs with Symfony Constraints and entity mapping logic
02Generates immutable final readonly Output DTOs with static factory methods
030 GitHub stars
04Detects project namespaces and entity structures directly from your codebase
05Automatically updates #[ApiResource] attributes with correct input, output, and state classes
06Scaffolds custom State Providers and Processors to handle DTO-Entity transformation

使用场景

01Decoupling API response structures from underlying database entity schemas
02Creating optimized read representations with calculated fields for specific API endpoints
03Implementing specialized validation logic for write operations without bloating entities