Skip to content

Commit a746820

Browse files
committed
fix: use html for code-selector
1 parent 85ec7ed commit a746820

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 for 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
@@ -89,7 +89,7 @@ the client.
8989

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

92-
[codeSelector]
92+
<code-selector>
9393

9494
```php
9595
<?php
@@ -146,7 +146,7 @@ App\Entity\Book:
146146
</resources>
147147
```
148148

149-
[/codeSelector]
149+
</code-selector>
150150

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

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

164-
[codeSelector]
164+
<code-selector>
165165

166166
```php
167167
// api/src/Entity/Book.php
@@ -217,13 +217,13 @@ App\Entity\Book:
217217
</resources>
218218
```
219219

220-
[/codeSelector]
220+
</code-selector>
221221

222222
## Using Serialization Groups
223223

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

226-
[codeSelector]
226+
<code-selector>
227227

228228
```php
229229
<?php
@@ -293,14 +293,14 @@ App\Entity\Book:
293293
</resources>
294294
```
295295

296-
[/codeSelector]
296+
</code-selector>
297297

298298
## Retrieving the Entity
299299

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

303-
[codeSelector]
303+
<code-selector>
304304

305305
```php
306306
<?php
@@ -357,7 +357,7 @@ App\Entity\Book:
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
@@ -429,7 +429,7 @@ App\Entity\Book:
429429
</resources>
430430
```
431431

432-
[/codeSelector]
432+
</code-selector>
433433

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

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
@@ -164,7 +164,7 @@ App\Entity\Book:
164164
</resources>
165165
```
166166

167-
[/codeSelector]
167+
</code-selector>
168168

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

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
@@ -116,4 +116,4 @@ App\Entity\Book:
116116
</resources>
117117
```
118118

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

0 commit comments

Comments
 (0)