diff --git a/core/subresources.md b/core/subresources.md index 3e8a98c6253..ef240f2c4a6 100644 --- a/core/subresources.md +++ b/core/subresources.md @@ -81,6 +81,13 @@ class Question } ``` +```yaml +# api/config/api_platform/resources.yaml +resources: + App\Entity\Answer: ~ + App\Entity\Question: ~ +``` + ```xml @@ -129,6 +136,21 @@ class Answer } ``` +```yaml +# api/config/api_platform/resources.yaml +resources: + App\Entity\Answer: + uriTemplate: /questions/{id}/answer + uriVariable: + id: + fromClass: App\Entity\Question + fromProperty: answer + operations: + ApiPlatform\Metadata\Get: ~ + + App\Entity\Question: ~ +``` + ```xml