Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/identifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ To help with your development experience, we introduced an identifier normalizat

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.

[codeSelector]
```php
<?php
namespace App\Entity;
Expand All @@ -32,6 +33,15 @@ final class Person
}
```

```xml
<resources xmlns="https://api-platform.com/schema/metadata">
<resource class="App\EntityPerson">
<property name="code" identifier="true"/>
</resource>
</resources>
```
[/codeSelector]

Once registered as an `ApiResource`, having an existing person, it will be accessible through the following URL: `/people/110e8400-e29b-11d4-a716-446655440000`.
Note that the property identifying our resource is named `code`.

Expand Down