Skip to content

Commit a16ddee

Browse files
authored
Merge pull request #185 from sawmurai/master
fix(): Update documentation to reflect changes in XML operations conf…
2 parents b7a2bd6 + 6d5be69 commit a16ddee

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

core/operations.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ Operations can be configured using annotations, XML or YAML. In the following ex
4949
for the `GET` method for both `collectionOperations` and `itemOperations` to create a readonly endpoint.
5050

5151
`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.
5354

5455
<configurations>
5556

@@ -87,12 +88,16 @@ AppBundle\Entity\Book:
8788
<?xml version="1.0" encoding="UTF-8" ?>
8889
<resources>
8990
<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>
96101
</resource>
97102
</resources>
98103
```
@@ -150,17 +155,19 @@ AppBundle\Entity\Book:
150155
<?xml version="1.0" encoding="UTF-8" ?>
151156
<resources>
152157
<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>
164171
</resource>
165172
</resources>
166173
```
@@ -230,12 +237,14 @@ AppBundle\Entity\Book:
230237
<?xml version="1.0" encoding="UTF-8" ?>
231238
<resources>
232239
<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>
239248
</resource>
240249
</resources>
241250
```

0 commit comments

Comments
 (0)