@@ -70,9 +70,9 @@ class Book
70
70
```
71
71
72
72
``` yaml
73
- # src/AppBundle/Resources /config/api_resources.yml
74
- product :
75
- class : ' AppBundle\Entity\Book'
73
+ # app /config/api_resources.yml
74
+
75
+ AppBundle\Entity\Book :
76
76
collectionOperations :
77
77
get :
78
78
method : ' GET' # nothing more to add if we want to keep the default controller
@@ -82,16 +82,17 @@ product:
82
82
` ` `
83
83
84
84
` ` ` xml
85
- <!-- src/AppBundle/Resources/config/api_resources.xml -->
85
+ <!-- app/config/api_resources.xml -->
86
+
86
87
<?xml version="1.0" encoding="UTF-8" ?>
87
88
<resources>
88
89
<resource class="AppBundle\Entity\Book">
89
- <itemOperations type="collection ">
90
- <operation key="get" method=" GET" / >
91
- </itemOperations >
92
- <collectionOperations type="collection ">
93
- <operation key="get" method=" GET" / >
94
- </collectionOperations >
90
+ <itemOperation name="get ">
91
+ <attribute name=" method"> GET</attribute >
92
+ </itemOperation >
93
+ <collectionOperation name="get ">
94
+ <attribute name=" method"> GET</attribute >
95
+ </collectionOperation >
95
96
</resource>
96
97
</resources>
97
98
```
@@ -130,9 +131,9 @@ class Book
130
131
```
131
132
132
133
``` yaml
133
- # src/AppBundle/Resources /config/api_resources.yml
134
- product :
135
- class : ' AppBundle\Entity\Book'
134
+ # app /config/api_resources.yml
135
+
136
+ AppBundle\Entity\Book :
136
137
itemOperations :
137
138
get :
138
139
method : ' GET'
@@ -144,18 +145,22 @@ product:
144
145
` ` `
145
146
146
147
` ` ` xml
147
- <!-- src/Acme/BlogBundle/Resources/config/api_resources.xml -->
148
+ <!-- app/config/api_resources.xml -->
149
+
148
150
<?xml version="1.0" encoding="UTF-8" ?>
149
151
<resources>
150
152
<resource class="AppBundle\Entity\Book">
151
- <itemOperations type="collection">
152
- <operation key="get" method="GET" />
153
- <operation key="put" method="GET" path="/grimoire/{id}/update">
154
- <attribute key="hydra_context" type="collection">
155
- <attribute key="foo">bar</attribute>
156
- </attribute>
157
- </operation>
158
- </itemOperations>
153
+ <itemOperation name="get">
154
+ <attribute name="method">GET</attribute>
155
+ <attribute name="path">/grimoire/{id}</attribute>
156
+ </itemOperation>
157
+ <itemOperation name="put">
158
+ <attribute name="method">PUT</attribute>
159
+ <attribute name="path">/grimoire/{id}/update</attribute>
160
+ <attribute name="hydra_context">
161
+ <attribute name="foo">bar</attribute>
162
+ </attribute>
163
+ </itemOperation>
159
164
</resource>
160
165
</resources>
161
166
```
@@ -209,9 +214,9 @@ class Book
209
214
```
210
215
211
216
``` yaml
212
- # src/AppBundle/Resources/ config/resources .yml
213
- product :
214
- class : ' AppBundle\Entity\Book'
217
+ # app/ config/api_resources .yml
218
+
219
+ AppBundle\Entity\Book :
215
220
itemOperations :
216
221
get :
217
222
method : ' GET'
@@ -220,14 +225,17 @@ product:
220
225
` ` `
221
226
222
227
` ` ` xml
223
- <!-- src/Acme/BlogBundle/Resources/config/resources.xml -->
228
+ <!-- app/config/api_resources.xml -->
229
+
224
230
<?xml version="1.0" encoding="UTF-8" ?>
225
231
<resources>
226
232
<resource class="AppBundle\Entity\Book">
227
- <itemOperations type="collection">
228
- <operation key="get" method="GET" />
229
- <operation key="special" routeName="book_special" />
230
- </itemOperations>
233
+ <itemOperation name="get">
234
+ <attribute name="method">GET</attribute>
235
+ </itemOperation>
236
+ <itemOperation name="special">
237
+ <attribute name="route_name">book_special</attribute>
238
+ </itemOperation>
231
239
</resource>
232
240
</resources>
233
241
```
0 commit comments