You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/operations.md
+22-8Lines changed: 22 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@ an implementation point of view, an operation is a link between a resource, a ro
6
6
<palign="center"class="symfonycasts"><ahref="https://symfonycasts.com/screencast/api-platform/operations?cid=apip"><imgsrc="../symfony/images/symfonycasts-player.png"alt="Operations screencast"><br>Watch the Operations screencast</a></p>
7
7
8
8
API Platform automatically registers typical [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations
9
-
and describes them in the exposed documentation (Hydra and Swagger). It also creates and registers routes corresponding
10
-
to these operations in the Symfony routing system (if it is available).
9
+
and describes them in the exposed documentation (Hydra and Swagger). It also creates and registers routes
10
+
for these operations in the Symfony routing system, if available, or in the Laravel routing system,
11
+
should that be the case.
11
12
12
13
The behavior of built-in operations is briefly presented in the [Getting started](getting-started.md#mapping-the-entities)
`PATCH` | no | Apply a partial modification to an element | yes
43
44
`DELETE` | no | Delete an element | yes
44
45
45
-
Note: the `PATCH` method must be enabled explicitly in the configuration, refer to the [Content Negotiation](content-negotiation.md) section for more information.
46
+
> [!NOTE]
47
+
> The `PATCH` method must be enabled explicitly in the configuration, refer to the [Content Negotiation](content-negotiation.md) section for more information.
46
48
47
-
Note: with JSON Merge Patch, the [null values will be skipped](https://symfony.com/doc/current/components/serializer.html#skipping-null-values) in the response.
49
+
---
48
50
49
-
Note: Current `PUT` implementation behaves more or less like the `PATCH` method.
50
-
Existing properties not included in the payload are **not** removed, their current values are preserved.
51
-
To remove an existing property, its value must be explicitly set to `null`.
51
+
> [!NOTE]
52
+
> With JSON Merge Patch, the [null values will be skipped](https://symfony.com/doc/current/components/serializer.html#skipping-null-values) in the response.
53
+
54
+
---
55
+
56
+
> [!NOTE]
57
+
> Current `PUT` implementation behaves more or less like the `PATCH` method.
58
+
> Existing properties not included in the payload are **not** removed, their current values are preserved.
59
+
> To remove an existing property, its value must be explicitly set to `null`.
52
60
53
61
## Enabling and Disabling Operations
54
62
@@ -64,7 +72,13 @@ for the `GET` method for both `collection` and `item` to create a readonly endpo
64
72
If the operation's name matches a supported HTTP method (`GET`, `POST`, `PUT`, `PATCH` or `DELETE`), the corresponding `method` property
65
73
will be automatically added.
66
74
67
-
Note: The `#[GetCollection]` attribute is an alias for `#[Get(collection: true)]`
75
+
> [!TIP]
76
+
> The `#[GetCollection]` attribute is an alias for `#[Get(collection: true)]`
77
+
78
+
---
79
+
80
+
> [!NOTE]
81
+
> In Symfony we use the term “entities”, while the following documentation is mostly for Laravel “models”.
0 commit comments