Skip to content

Commit 639a7e4

Browse files
authored
show XML syntax for @ApiProperty(identifier=true) (#1250)
1 parent 6370612 commit 639a7e4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/identifiers.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ To help with your development experience, we introduced an identifier normalizat
99
1010
Let's say you have the following class, which is identified by a `UUID` type. In this example, `UUID` is not a simple string but an object with many attributes.
1111

12+
[codeSelector]
1213
```php
1314
<?php
1415
namespace App\Entity;
@@ -32,6 +33,15 @@ final class Person
3233
}
3334
```
3435

36+
```xml
37+
<resources xmlns="https://api-platform.com/schema/metadata">
38+
<resource class="App\EntityPerson">
39+
<property name="code" identifier="true"/>
40+
</resource>
41+
</resources>
42+
```
43+
[/codeSelector]
44+
3545
Once registered as an `ApiResource`, having an existing person, it will be accessible through the following URL: `/people/110e8400-e29b-11d4-a716-446655440000`.
3646
Note that the property identifying our resource is named `code`.
3747

0 commit comments

Comments
 (0)