Skip to content

Commit c7d5ac8

Browse files
committed
do not use dto word for object relations
1 parent e08bbb2 commit c7d5ac8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

core/dto.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ When specified, `input` and `output` attributes support:
243243
- an array to specify more metadata for example `['class' => BookInput::class, 'name' => 'BookInput', 'iri' => '/book_input']`
244244

245245

246-
## Using DTO objects inside resources
246+
## Using objects as relations inside resources
247247

248248
Because ApiPlatform can (de)normalize anything in the supported formats (`jsonld`, `jsonapi`, `hal`, etc.), you can use any object you want inside resources. For example, let's say that the `Book` has an `attribute` property that can't be represented by a resource, we can do the following:
249249

@@ -254,13 +254,10 @@ Because ApiPlatform can (de)normalize anything in the supported formats (`jsonld
254254
namespace App\Entity;
255255

256256
use ApiPlatform\Core\Annotation\ApiResource;
257-
use App\Dto\Attribute;
257+
use App\Model\Attribute;
258258

259259
/**
260-
* @ApiResource(
261-
* input=BookInput::class,
262-
* output=BookOutput::class
263-
* )
260+
* @ApiResource
264261
*/
265262
final class Book
266263
{

0 commit comments

Comments
 (0)