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
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ the client.
85
85
86
86
The routing has not been configured yet because we will add it at the resource configuration level:
87
87
88
-
[codeSelector]
88
+
<code-selector>
89
89
90
90
```php
91
91
<?php
@@ -143,7 +143,7 @@ resources:
143
143
</resources>
144
144
```
145
145
146
-
[/codeSelector]
146
+
</code-selector>
147
147
148
148
It is mandatory to set the `method`, `uriTemplate` and `controller` attributes. They allow API Platform to configure the routing path and
149
149
the associated controller respectively.
@@ -158,7 +158,7 @@ To avoid that, API Platform provides the `ApiPlatform\Action\PlaceholderAction`
158
158
159
159
You just need to set the `controller` attribute with this class. Here, the previous example updated:
160
160
161
-
[codeSelector]
161
+
<code-selector>
162
162
163
163
```php
164
164
// api/src/Entity/Book.php
@@ -215,13 +215,13 @@ resources:
215
215
</resources>
216
216
```
217
217
218
-
[/codeSelector]
218
+
</code-selector>
219
219
220
220
## Using Serialization Groups
221
221
222
222
You may want different serialization groups for your custom operations. Just configure the proper `normalizationContext` and/or `denormalizationContext` in your operation:
223
223
224
-
[codeSelector]
224
+
<code-selector>
225
225
226
226
```php
227
227
<?php
@@ -292,14 +292,14 @@ resources:
292
292
</resources>
293
293
```
294
294
295
-
[/codeSelector]
295
+
</code-selector>
296
296
297
297
## Retrieving the Entity
298
298
299
299
If you want to bypass the automatic retrieval of the entity in your custom operation, you can set `read: false` in the
300
300
operation attribute:
301
301
302
-
[codeSelector]
302
+
<code-selector>
303
303
304
304
```php
305
305
<?php
@@ -357,7 +357,7 @@ resources:
357
357
</resources>
358
358
```
359
359
360
-
[/codeSelector]
360
+
</code-selector>
361
361
362
362
This way, it will skip the `ReadListener`. You can do the same for some other built-in listeners. See [Built-in Event Listeners](events.md#built-in-event-listeners)
363
363
for more information.
@@ -377,7 +377,7 @@ for `book_post_discontinuation` when neither `method` nor `routeName` attributes
377
377
378
378
First, let's create your resource configuration:
379
379
380
-
[codeSelector]
380
+
<code-selector>
381
381
382
382
```php
383
383
<?php
@@ -430,7 +430,7 @@ resources:
430
430
</resources>
431
431
```
432
432
433
-
[/codeSelector]
433
+
</code-selector>
434
434
435
435
API Platform will automatically map this `post_publication` operation to the route `book_post_publication`. Let's create a custom action
Copy file name to clipboardExpand all lines: core/deprecations.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ class Parchment
67
67
68
68
It's also possible to deprecate a single property:
69
69
70
-
[codeSelector]
70
+
<code-selector>
71
71
72
72
```php
73
73
<?php
@@ -99,7 +99,7 @@ properties:
99
99
deprecationReason: 'Use the rating property instead'
100
100
```
101
101
102
-
[/codeSelector]
102
+
</code-selector>
103
103
104
104
* With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
105
105
* With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
Copy file name to clipboardExpand all lines: core/dto.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ final class BookRepresentationProvider implements ProviderInterface
124
124
125
125
For returning another representation of your data in a [State Processor](./state-processors.md), you should specify your processor class in the `processor` attribute and same for your `output`.
126
126
127
-
[codeSelector]
127
+
<code-selector>
128
128
129
129
```php
130
130
<?php
@@ -165,7 +165,7 @@ resources:
165
165
</resources>
166
166
```
167
167
168
-
[/codeSelector]
168
+
</code-selector>
169
169
170
170
Here the `$data` attribute represents an instance of your resource.
0 commit comments