@@ -49,7 +49,8 @@ Operations can be configured using annotations, XML or YAML. In the following ex
49
49
for the ` GET ` method for both ` collectionOperations ` and ` itemOperations ` to create a readonly endpoint.
50
50
51
51
` itemOperations ` and ` collectionOperations ` are arrays containing a list of operation. Each operation is defined by a key
52
- corresponding to the name of the operation that can be anything you want and an array of properties as value.
52
+ corresponding to the name of the operation that can be anything you want and an array of properties as value. If an
53
+ empty list of operations is provided, all operations are disabled.
53
54
54
55
<configurations >
55
56
@@ -87,12 +88,16 @@ AppBundle\Entity\Book:
87
88
<?xml version="1.0" encoding="UTF-8" ?>
88
89
<resources>
89
90
<resource class="AppBundle\Entity\Book">
90
- <itemOperation name="get">
91
- <attribute name="method">GET</attribute>
92
- </itemOperation>
93
- <collectionOperation name="get">
94
- <attribute name="method">GET</attribute>
95
- </collectionOperation>
91
+ <itemOperations>
92
+ <itemOperation name="get">
93
+ <attribute name="method">GET</attribute>
94
+ </itemOperation>
95
+ </itemOperations>
96
+ <collectionOperations>
97
+ <collectionOperation name="get">
98
+ <attribute name="method">GET</attribute>
99
+ </collectionOperation>
100
+ </collectionOperations>
96
101
</resource>
97
102
</resources>
98
103
```
@@ -150,17 +155,19 @@ AppBundle\Entity\Book:
150
155
<?xml version="1.0" encoding="UTF-8" ?>
151
156
<resources>
152
157
<resource class="AppBundle\Entity\Book">
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>
158
+ <itemOperations>
159
+ <itemOperation name="get">
160
+ <attribute name="method">GET</attribute>
161
+ <attribute name="path">/grimoire/{id}</attribute>
162
+ </itemOperation>
163
+ <itemOperation name="put">
164
+ <attribute name="method">PUT</attribute>
165
+ <attribute name="path">/grimoire/{id}/update</attribute>
166
+ <attribute name="hydra_context">
167
+ <attribute name="foo">bar</attribute>
168
+ </attribute>
169
+ </itemOperation>
170
+ </itemOperations>
164
171
</resource>
165
172
</resources>
166
173
```
@@ -230,12 +237,14 @@ AppBundle\Entity\Book:
230
237
<?xml version="1.0" encoding="UTF-8" ?>
231
238
<resources>
232
239
<resource class="AppBundle\Entity\Book">
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>
240
+ <itemOperations>
241
+ <itemOperation name="get">
242
+ <attribute name="method">GET</attribute>
243
+ </itemOperation>
244
+ <itemOperation name="special">
245
+ <attribute name="route_name">book_special</attribute>
246
+ </itemOperation>
247
+ </itemOperations>
239
248
</resource>
240
249
</resources>
241
250
```
0 commit comments