Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added notes on the DTO page, about serialization groups #1695

Open
wants to merge 2 commits into
base: 3.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/dto.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ final class UserResetPasswordDto
}
```

**Note**: if you have any *denormalizationContext* groups on the *User* entity (or just on the entity *Post* operation), make sure to annotate the fields in the DTO class accordingly.

```php
<?php
// api/src/Model/User.php
Expand Down Expand Up @@ -88,6 +90,8 @@ This will dispatch the `App\Dto\Message` via [Symfony Messenger](https://symfony

To return another representation of your data in a [State Provider](./state-providers.md) we advise to specify the `output` attribute of the resource. Note that this technique works without any changes to the resource but your API documentation would be wrong.

**Note**: if you have any *normalizationContext* groups on the *User* entity (or just on the entity *Get* operation), make sure to annotate the fields in the DTO class accordingly.

```php
<?php

Expand Down