Skip to content

Commit 6e3aabb

Browse files
jzabrodinalanpoulain
authored andcommitted
docs: add YAML notation for single property deprecation
Add yaml notation for single property deprecation
1 parent 7ea43d9 commit 6e3aabb

File tree

5 files changed

+38
-22
lines changed

5 files changed

+38
-22
lines changed

core/default-order.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Book
3131
```
3232

3333
```yaml
34-
# config/api/resources/Book.yaml
34+
# api/config/api_platform/resources/Book.yaml
3535
App\Entity\Book:
3636
attributes:
3737
order:
@@ -74,7 +74,7 @@ class Book
7474
```
7575

7676
```yaml
77-
# config/api/resources/Book.yaml
77+
# api/config/api_platform/resources/Book.yaml
7878
App\Entity\Book:
7979
attributes:
8080
order: ['foo', 'bar']
@@ -110,7 +110,7 @@ class Book
110110
```
111111

112112
```yaml
113-
# config/api/resources/Book.yaml
113+
# api/config/api_platform/resources/Book.yaml
114114
App\Entity\Book:
115115
attributes:
116116
order: ['author.username']
@@ -144,7 +144,7 @@ class Book
144144
```
145145

146146
```yaml
147-
# config/api/resources/Book.yaml
147+
# api/config/api_platform/resources/Book.yaml
148148
App\Entity\Book:
149149
get: ~
150150
get_desc_custom:

core/deprecations.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class Parchment
7373

7474
It's also possible to deprecate a single property:
7575

76+
[codeSelector]
77+
7678
```php
7779
<?php
7880
// api/src/Entity/Review.php
@@ -98,6 +100,20 @@ class Review
98100
}
99101
```
100102

103+
```yaml
104+
# api/config/api_platform/resources/Review.yaml
105+
resources:
106+
# ...
107+
App\Entity\Review:
108+
properties:
109+
# ...
110+
letter:
111+
attributes:
112+
deprecation_reason: 'Use the rating property instead'
113+
```
114+
115+
[/codeSelector]
116+
101117
* 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
102118
* With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
103119
* With GraphQL, the [`isDeprecated` and `deprecationReason` properties](https://facebook.github.io/graphql/June2018/#sec-Deprecation) will be added to the schema

core/identifiers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class Person
3535
```
3636

3737
```yaml
38-
# config/api/resources/Person.yaml
38+
# api/config/api_platform/resources/Person.yaml
3939
App\Entity\Person:
4040
properties:
4141
code:

core/security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Book
9898
```
9999

100100
```yaml
101-
# config/api/resources/Book.yaml
101+
# api/config/api_platform/resources/Book.yaml
102102
App\Entity\Book:
103103
properties:
104104
adminOnlyProperty:
@@ -213,7 +213,7 @@ class Book
213213
```
214214

215215
```yaml
216-
# config/api/resources/Book.yaml
216+
# api/config/api_platform/resources/Book.yaml
217217
App\Entity\Book:
218218
attributes:
219219
security: 'is_granted("ROLE_USER")'

core/serialization.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class Book
199199
```
200200

201201
```yaml
202-
# config/api/resources/Book.yaml
202+
# api/config/api_platform/resources/Book.yaml
203203
App\Entity\Book:
204204
attributes:
205205
normalization_context:
@@ -210,7 +210,7 @@ App\Entity\Book:
210210
normalization_context:
211211
groups: ['put']
212212
213-
# config/serializer/Book.yaml
213+
# api/config/serializer/Book.yaml
214214
App\Entity\Book:
215215
attributes:
216216
name:
@@ -305,21 +305,21 @@ class Person
305305
```
306306

307307
```yaml
308-
# config/api/resources/Book.yaml
308+
# api/config/api_platform/resources/Book.yaml
309309
App\Entity\Book:
310310
attributes:
311311
normalization_context:
312312
groups: ['book']
313313
314-
# config/serializer/Book.yaml
314+
# api/config/serializer/Book.yaml
315315
App\Entity\Book:
316316
attributes:
317317
name:
318318
groups: ['book']
319319
author:
320320
groups: ['book']
321321
322-
# config/serializer/Person.yaml
322+
# api/config/serializer/Person.yaml
323323
App\Entity\Person:
324324
attributes:
325325
name:
@@ -373,7 +373,7 @@ class Book
373373
```
374374

375375
```yaml
376-
# config/api/resources/Book.yaml
376+
# api/config/api_platform/resources/Book.yaml
377377
App\Entity\Book:
378378
attributes:
379379
denormalization_context:
@@ -432,15 +432,15 @@ class Person
432432
```
433433

434434
```yaml
435-
# config/api/resources/Person.yaml
435+
# api/config/api_platform/resources/Person.yaml
436436
App\Entity\Person:
437437
attributes:
438438
normalization_context:
439439
groups: ['person']
440440
denormalization_context:
441441
groups: ['person']
442442
443-
# config/serializer/Person.yaml
443+
# api/config/serializer/Person.yaml
444444
App\Entity\Person:
445445
attributes:
446446
name:
@@ -495,7 +495,7 @@ class Person
495495
```
496496

497497
```yaml
498-
# config/api/resources/Person.yaml
498+
# api/config/api_platform/resources/Person.yaml
499499
App\Entity\Person:
500500
attributes:
501501
normalization_context:
@@ -507,7 +507,7 @@ App\Entity\Person:
507507
readableLink: false
508508
writableLink: false
509509
510-
# config/serializer/Person.yaml
510+
# api/config/serializer/Person.yaml
511511
App\Entity\Person:
512512
attributes:
513513
name:
@@ -692,14 +692,14 @@ class Greeting
692692
```
693693

694694
```yaml
695-
# config/api/resources/Greeting.yaml
695+
# api/config/api_platform/resources/Greeting.yaml
696696
App\Entity\Greeting:
697697
collectionOperations:
698698
get:
699699
normalization_context:
700700
groups: 'greeting:collection:get'
701701
702-
# config/serializer/Greeting.yaml
702+
# api/config/serializer/Greeting.yaml
703703
App\Entity\Greeting:
704704
attributes:
705705
id:
@@ -760,15 +760,15 @@ class Book
760760
```
761761

762762
```yaml
763-
# config/api/resources/Book.yaml
763+
# api/config/api_platform/resources/Book.yaml
764764
App\Entity\Book:
765765
attributes:
766766
normalization_context:
767767
groups: ['book:output']
768768
denormalization_context:
769769
groups: ['book:input']
770770
771-
# config/serializer/Book.yaml
771+
# api/config/serializer/Book.yaml
772772
App\Entity\Book:
773773
attributes:
774774
active:
@@ -1112,7 +1112,7 @@ class Book
11121112
```
11131113

11141114
```yaml
1115-
# config/api/resources/Book.yaml
1115+
# api/config/api_platform/resources/Book.yaml
11161116
App\Entity\Book:
11171117
attributes:
11181118
normalization_context:

0 commit comments

Comments
 (0)