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/controllers.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ This action will be automatically registered as a service (the service name is t
66
66
`App\Controller\CreateBookPublication`).
67
67
68
68
API Platform automatically retrieves the appropriate PHP entity using the data provider then deserializes user data in it,
69
-
and for `POST`and `PUT` requests updates the entity with data provided by the user.
69
+
and for `POST`, `PUT`and `PATCH` requests updates the entity with data provided by the user.
70
70
71
71
**Warning: when using `POST` or `PUT`, the `__invoke()` method parameter [MUST be called `$data`](https://symfony.com/doc/current/components/http_kernel.html#getting-the-controller-arguments)**, otherwise, it will not be filled correctly!
72
72
When using `GET`, the `__invoke()` method parameter should be called the same as the entity identifier. So for the path `/user/{uuid}/bookmarks`, you must use `__invoke($uuid)`.
Copy file name to clipboardExpand all lines: core/dto.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -203,7 +203,9 @@ services:
203
203
204
204
## Updating a Resource with a Custom Input
205
205
206
-
When performing an update (e.g. `PUT` operation), the resource to be updated is read by ApiPlatform before the deserialization phase. To do so, it uses a [data provider](data-providers.md) with the `:id` parameter given in the URL. The *body* of the request is the JSON object sent by the client, it is deserialized and is used to update the previously found resource.
206
+
When performing an update (e.g. `PUT` operation), the resource to be updated is read by API Platform before the deserialization phase.
207
+
To do so, it uses a [data provider](data-providers.md) with the `:id` parameter given in the URL.
208
+
The *body* of the request is the JSON object sent by the client, it is deserialized and is used to update the previously found resource.
207
209
208
210

`AddFormatListener` | `kernel.request` | None | 7 | Guesses the best response format ([content negotiation](content-negotiation.md))
28
-
`ReadListener` | `kernel.request` | `PRE_READ`, `POST_READ` | 4 | Retrieves data from the persistence system using the [data providers](data-providers.md) (`GET`, `PUT`, `DELETE`)
29
-
`DeserializeListener` | `kernel.request` | `PRE_DESERIALIZE`, `POST_DESERIALIZE` | 2 | Deserializes data into a PHP entity (`GET`, `POST`, `DELETE`); updates the entity retrieved using the data provider (`PUT`)
28
+
`ReadListener` | `kernel.request` | `PRE_READ`, `POST_READ` | 4 | Retrieves data from the persistence system using the [data providers](data-providers.md) (`GET`, `PUT`, `PATCH`, `DELETE`)
29
+
`DeserializeListener` | `kernel.request` | `PRE_DESERIALIZE`, `POST_DESERIALIZE` | 2 | Deserializes data into a PHP entity (`GET`, `POST`, `DELETE`); updates the entity retrieved using the data provider (`PUT`, `PATCH`)
`WriteListener` | `kernel.view` | `PRE_WRITE`, `POST_WRITE` | 32 | Persists changes in the persistence system using the [data persisters](data-persisters.md) (`POST`, `PUT`, `DELETE`)
`WriteListener` | `kernel.view` | `PRE_WRITE`, `POST_WRITE` | 32 | Persists changes in the persistence system using the [data persisters](data-persisters.md) (`POST`, `PUT`, `PATCH`, `DELETE`)
33
33
`SerializeListener` | `kernel.view` | `PRE_SERIALIZE`, `POST_SERIALIZE` | 16 | Serializes the PHP entity in string [according to the request format](content-negotiation.md)
34
34
`RespondListener` | `kernel.view` | `PRE_RESPOND`, `POST_RESPOND` | 8 | Transforms serialized to a `Symfony\Component\HttpFoundation\Response` instance
35
35
`AddLinkHeaderListener` | `kernel.response` | None | 0 | Adds a `Link` HTTP header pointing to the Hydra documentation
Copy file name to clipboardExpand all lines: core/operations.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -598,7 +598,7 @@ class Weather
598
598
// ...
599
599
```
600
600
601
-
This will expose the `Weather` model, but also all the default CRUD routes: `GET`, `PUT`, `DELETE` and `POST`, which is a non-sense in our context.
601
+
This will expose the `Weather` model, but also all the default CRUD routes: `GET`, `PUT`, `PATCH`, `DELETE` and `POST`, which is a non-sense in our context.
602
602
Since we are required to expose at least one route, let's expose just one:
Copy file name to clipboardExpand all lines: core/security.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ Available variables are:
121
121
* `request`: the current request
122
122
123
123
Access control checks in the `security` attribute are always executed before the [denormalization step](serialization.md).
124
-
It means than for `PUT` requests, `object` doesn't contain the value submitted by the user, but values currently stored in [the persistence layer](data-persisters.md).
124
+
It means than for `PUT` or `PATCH` requests, `object` doesn't contain the value submitted by the user, but values currently stored in [the persistence layer](data-persisters.md).
125
125
126
126
## Executing Access Control Rules After Denormalization
Copy file name to clipboardExpand all lines: core/serialization.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ Alternatively, you can use the more verbose syntax:
139
139
```
140
140
141
141
In the previous example, the `name` property will be visible when reading (`GET`) the object, and it will also be available
142
-
to write (`PUT/POST`). The `author` property will be write-only; it will not be visible when serialized responses are
142
+
to write (`PUT` / `PATCH` / `POST`). The `author` property will be write-only; it will not be visible when serialized responses are
143
143
returned by the API.
144
144
145
145
Internally, API Platform passes the value of the `normalization_context` as the 3rd argument of [the `Serializer::serialize()` method](https://api.symfony.com/master/Symfony/Component/Serializer/SerializerInterface.html#method_serialize) during the normalization
@@ -352,7 +352,7 @@ Instead of embedding relations in the main HTTP response, you may want [to "push
352
352
353
353
### Denormalization
354
354
355
-
It is also possible to embed a relation in `PUT` and `POST` requests. To enable that feature, set the serialization groups
355
+
It is also possible to embed a relation in `PUT`, `PATCH` and `POST` requests. To enable that feature, set the serialization groups
0 commit comments