Skip to content

Commit f862cae

Browse files
authored
Add a tip to use MakerBundle to create resources
1 parent b2da160 commit f862cae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/getting-started.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ class Offer
143143
It is the minimal configuration required to expose `Product` and `Offer` entities as JSON-LD documents through an hypermedia
144144
web API.
145145

146+
**Tip**: if you create your entities with Symfony's [MakerBundle](https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html), you can also create your API resource entities with the `--api-resource` argument:
147+
148+
```sh
149+
php bin/console make:entity --api-resource
150+
```
151+
146152
If you are familiar with the Symfony ecosystem, you noticed that entity classes are also mapped with Doctrine ORM annotations
147153
and validation constraints from [the Symfony Validator Component](http://symfony.com/doc/current/book/validation.html).
148154
This isn't mandatory. You can use [your preferred persistence](data-providers.md) and [validation](validation.md) systems.

0 commit comments

Comments
 (0)