File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,7 @@ use App\Controller\BookSpecial;
556
556
* @ApiResource(itemOperations={
557
557
* "get",
558
558
* "special"={
559
+ * "method"="GET",
559
560
* "path"="/books/{id}/special",
560
561
* "controller"=BookSpecial::class
561
562
* }
@@ -575,6 +576,7 @@ App\Entity\Book:
575
576
itemOperations:
576
577
get: ~
577
578
special:
579
+ method: 'GET'
578
580
path: '/books/{id}/special'
579
581
controller: 'App\C ontroller\B ookSpecial'
580
582
` ` `
@@ -593,6 +595,7 @@ Or in XML:
593
595
<itemOperations>
594
596
<itemOperation name="get" />
595
597
<itemOperation name="special">
598
+ <attribute name="method">GET</attribute>
596
599
<attribute name="path">/books/{id}/special</attribute>
597
600
<attribute name="controller">App\C ontroller\B ookSpecial</attribute>
598
601
</itemOperation>
@@ -601,7 +604,7 @@ Or in XML:
601
604
</resources>
602
605
` ` `
603
606
604
- It is mandatory to set the `path` and `controller` attributes. They allow API platform to configure the routing path and
607
+ It is mandatory to set the `method`, ` path` and `controller` attributes. They allow API platform to configure the routing path and
605
608
the associated controller respectively.
606
609
607
610
If you want to bypass the automatic retrieval of the entity in your custom operation, you can set the parameter
You can’t perform that action at this time.
0 commit comments