# API Platform DTO Resources Reference (Symfony) > **Versions.** Written for **API Platform 5.0** (Symfony 7.4 LTS / 8.x). It also > runs on **4.4**, the 4 to 5 bridge release (same features, plus the APIs that > 5.0 removed), except where flagged. **4.3** is the last release supporting > **Symfony 6.4 LTS**; **3.4** is unmaintained (legacy). Deltas are flagged > inline as **5.0**, **4.4+**, **4.3** or **3.4**. The biggest v3→v4 DTO change: **`DataTransformerInterface` is gone** (already removed by v3.4) and v4 introduced **Symfony Object Mapper** as the declarative mapping path. The Object Mapper needs `symfony/object-mapper`, which requires **Symfony 7.3+**: on Symfony 6.4 LTS (API Platform 4.3), use the manual provider/processor strategy. ## Core idea The `#[ApiResource]` class IS the DTO — the API contract — decoupled from your Doctrine entity. You map between the two either declaratively (Object Mapper, v4) or manually (custom provider/processor, works in both v3.4 and v4). ## Strategy 1 (v4) — DTO resource + Object Mapper + stateOptions Requires `symfony/object-mapper:^7.4|^8.0`. When the resource has `stateOptions` with an `entityClass` **and** both the DTO and entity carry `#[Map]`, API Platform decorates the Doctrine provider/processor with the Object Mapper variants automatically. ```php attributes->get('read_data'); $entity->price = (int) ($entity->price * (1 - $data->percentage / 100)); return $this->objectMapper->map($entity, Book::class); } } ``` ```php new Post( uriTemplate: '/books/{id}/discount', input: DiscountBook::class, processor: DiscountBookProcessor::class, ) ``` ## v3.4 approach (for comparison / legacy code) v3.4 has no Object Mapper. You declare `input` / `output` and map **manually** inside a custom `ProviderInterface` (read) and `ProcessorInterface` (write): ```php // v3.4 #[Post(input: UserResetPasswordDto::class, processor: UserResetPasswordProcessor::class)] final class User {} #[Get(output: AnotherRepresentation::class, provider: BookRepresentationProvider::class)] class Book {} ``` > `DataTransformerInterface` (`transform()` / `supportsTransformation()`) was the v2.x mechanism — **already removed by v3.4**. Do not reach for it; use providers/processors (v3.4) or Object Mapper (v4). The manual provider/processor approach **still works in v4** — Object Mapper is the new *declarative* shortcut, not a forced replacement. ## Validation commands - ./vendor/bin/phpunit --filter=Book - php bin/console api:openapi:export - php bin/console debug:router