Skip to content

Commit 9c55ff9

Browse files
committed
Merge 3.0
2 parents 4282f31 + a746820 commit 9c55ff9

18 files changed

+124
-124
lines changed

core/content-negotiation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ this configuration might disable the `json` or the `html` on this resource for e
121121

122122
You can specify different accepted formats at operation level too, it's especially convenient to configure formats available for the `PATCH` method:
123123

124-
[codeSelector]
124+
<code-selector>
125125

126126
```php
127127
<?php
@@ -178,7 +178,7 @@ resources:
178178
</resources>
179179
```
180180

181-
[/codeSelector]
181+
</code-selector>
182182

183183
## Supporting Custom Formats
184184

core/controllers.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ the client.
8585

8686
The routing has not been configured yet because we will add it at the resource configuration level:
8787

88-
[codeSelector]
88+
<code-selector>
8989

9090
```php
9191
<?php
@@ -143,7 +143,7 @@ resources:
143143
</resources>
144144
```
145145

146-
[/codeSelector]
146+
</code-selector>
147147

148148
It is mandatory to set the `method`, `uriTemplate` and `controller` attributes. They allow API Platform to configure the routing path and
149149
the associated controller respectively.
@@ -158,7 +158,7 @@ To avoid that, API Platform provides the `ApiPlatform\Action\PlaceholderAction`
158158

159159
You just need to set the `controller` attribute with this class. Here, the previous example updated:
160160

161-
[codeSelector]
161+
<code-selector>
162162

163163
```php
164164
// api/src/Entity/Book.php
@@ -215,13 +215,13 @@ resources:
215215
</resources>
216216
```
217217

218-
[/codeSelector]
218+
</code-selector>
219219

220220
## Using Serialization Groups
221221

222222
You may want different serialization groups for your custom operations. Just configure the proper `normalizationContext` and/or `denormalizationContext` in your operation:
223223

224-
[codeSelector]
224+
<code-selector>
225225

226226
```php
227227
<?php
@@ -292,14 +292,14 @@ resources:
292292
</resources>
293293
```
294294

295-
[/codeSelector]
295+
</code-selector>
296296

297297
## Retrieving the Entity
298298

299299
If you want to bypass the automatic retrieval of the entity in your custom operation, you can set `read: false` in the
300300
operation attribute:
301301

302-
[codeSelector]
302+
<code-selector>
303303

304304
```php
305305
<?php
@@ -357,7 +357,7 @@ resources:
357357
</resources>
358358
```
359359

360-
[/codeSelector]
360+
</code-selector>
361361

362362
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)
363363
for more information.
@@ -377,7 +377,7 @@ for `book_post_discontinuation` when neither `method` nor `routeName` attributes
377377

378378
First, let's create your resource configuration:
379379

380-
[codeSelector]
380+
<code-selector>
381381

382382
```php
383383
<?php
@@ -430,7 +430,7 @@ resources:
430430
</resources>
431431
```
432432

433-
[/codeSelector]
433+
</code-selector>
434434

435435
API Platform will automatically map this `post_publication` operation to the route `book_post_publication`. Let's create a custom action
436436
and its related route using attributes:

core/default-order.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ API Platform provides an easy way to override the default order of items in your
55
By default, items in the collection are ordered in ascending (ASC) order by their resource identifier(s). If you want to
66
customize this order, you must add an `order` attribute on your ApiResource annotation:
77

8-
[codeSelector]
8+
<code-selector>
99

1010
```php
1111
<?php
@@ -35,12 +35,12 @@ App\Entity\Book:
3535
foo: ASC
3636
```
3737
38-
[/codeSelector]
38+
</code-selector>
3939
4040
This `order` attribute is used as an array: the key defines the order field, the values defines the direction.
4141
If you only specify the key, `ASC` direction will be used as default. For example, to order by `foo` & `bar`:
4242

43-
[codeSelector]
43+
<code-selector>
4444

4545
```php
4646
<?php
@@ -74,11 +74,11 @@ App\Entity\Book:
7474
order: ['foo', 'bar']
7575
```
7676

77-
[/codeSelector]
77+
</code-selector>
7878

7979
It's also possible to configure the default order on an association property:
8080

81-
[codeSelector]
81+
<code-selector>
8282

8383
```php
8484
<?php
@@ -107,11 +107,11 @@ App\Entity\Book:
107107
order: ['author.username']
108108
```
109109

110-
[/codeSelector]
110+
</code-selector>
111111

112112
Another possibility is to apply the default order for a specific collection operation, which will override the global default order configuration.
113113

114-
[codeSelector]
114+
<code-selector>
115115

116116
```php
117117
<?php
@@ -155,4 +155,4 @@ App\Entity\Book:
155155
name: ASC
156156
```
157157

158-
[/codeSelector]
158+
</code-selector>

core/deprecations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Parchment
6767

6868
It's also possible to deprecate a single property:
6969

70-
[codeSelector]
70+
<code-selector>
7171

7272
```php
7373
<?php
@@ -99,7 +99,7 @@ properties:
9999
deprecationReason: 'Use the rating property instead'
100100
```
101101
102-
[/codeSelector]
102+
</code-selector>
103103
104104
* 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
105105
* With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added

core/dto.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ final class BookRepresentationProvider implements ProviderInterface
124124

125125
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`.
126126

127-
[codeSelector]
127+
<code-selector>
128128

129129
```php
130130
<?php
@@ -165,7 +165,7 @@ resources:
165165
</resources>
166166
```
167167

168-
[/codeSelector]
168+
</code-selector>
169169

170170
Here the `$data` attribute represents an instance of your resource.
171171

core/extending-jsonld-context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Note that you do not have to provide the `@id` attribute. If you do not provide
6767

6868
It's also possible to replace the Hydra context used by the documentation generator:
6969

70-
[codeSelector]
70+
<code-selector>
7171

7272
```php
7373
<?php
@@ -117,4 +117,4 @@ resources:
117117
</resources>
118118
```
119119

120-
[/codeSelector]
120+
</code-selector>

0 commit comments

Comments
 (0)