File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,13 @@ class Question
8181}
8282```
8383
84+ ``` yaml
85+ # api/config/api_platform/resources.yaml
86+ resources :
87+ App\Entity\Answer : ~
88+ App\Entity\Question : ~
89+ ` ` `
90+
8491` ` ` xml
8592<?xml version="1.0" encoding="UTF-8" ?>
8693<!-- api/config/api_platform/resources.xml -->
@@ -129,6 +136,21 @@ class Answer
129136}
130137```
131138
139+ ``` yaml
140+ # api/config/api_platform/resources.yaml
141+ resources :
142+ App\Entity\Answer :
143+ uriTemplate : /questions/{id}/answer
144+ uriVariable :
145+ id :
146+ fromClass : App\Entity\Question
147+ fromProperty : answer
148+ operations :
149+ ApiPlatform\Metadata\Get : ~
150+
151+ App\Entity\Question : ~
152+ ` ` `
153+
132154` ` ` xml
133155<resources xmlns="https://api-platform.com/schema/metadata/resources-3.0"
134156 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -173,6 +195,19 @@ If we had a `relatedQuestions` property on the `Answer` we could retrieve the co
173195)]
174196```
175197
198+ ``` yaml
199+ # api/config/api_platform/resources.yaml
200+ resources :
201+ App\Entity\Question :
202+ uriTemplate : /answers/{id}/related_questions.{_format}
203+ uriVariable :
204+ id :
205+ fromClass : App\Entity\Answer
206+ fromProperty : relatedQuestions
207+ operations :
208+ ApiPlatform\Metadata\GetCollection : ~
209+ ` ` `
210+
176211` ` ` xml
177212<resource class="App\Entity\Question" uriTemplate="/answers/{id}/related_questions.{_format}">
178213 <uriVariables>
You can’t perform that action at this time.
0 commit comments