@@ -80,12 +80,14 @@ public function __construct(
80
80
81
81
/**
82
82
* Process and resolve input parameters
83
+ *
83
84
* Return array with validated input params
84
85
* or throw \Exception if at least one request entity params is not valid
85
86
*
86
87
* @return array
87
88
* @throws \Magento\Framework\Exception\InputException if no value is provided for required parameters
88
89
* @throws \Magento\Framework\Webapi\Exception
90
+ * @throws \Magento\Framework\Exception\AuthorizationException
89
91
*/
90
92
public function resolve ()
91
93
{
@@ -95,6 +97,13 @@ public function resolve()
95
97
$ this ->requestValidator ->validate ();
96
98
$ webapiResolvedParams = [];
97
99
$ inputData = $ this ->request ->getRequestData ();
100
+
101
+ $ httpMethod = $ this ->request ->getHttpMethod ();
102
+ if ($ httpMethod == \Magento \Framework \Webapi \Rest \Request::HTTP_METHOD_DELETE ) {
103
+ $ requestBodyParams = $ this ->request ->getBodyParams ();
104
+ $ inputData = array_merge ($ requestBodyParams , $ inputData );
105
+ }
106
+
98
107
foreach ($ inputData as $ key => $ singleEntityParams ) {
99
108
$ webapiResolvedParams [$ key ] = $ this ->resolveBulkItemParams ($ singleEntityParams );
100
109
}
@@ -103,6 +112,8 @@ public function resolve()
103
112
}
104
113
105
114
/**
115
+ * Detect route by input parameters
116
+ *
106
117
* @return \Magento\Webapi\Controller\Rest\Router\Route
107
118
*/
108
119
public function getRoute ()
@@ -111,9 +122,10 @@ public function getRoute()
111
122
}
112
123
113
124
/**
125
+ * Resolve parameters for service
126
+ *
114
127
* Convert the input array from key-value format to a list of parameters
115
128
* suitable for the specified class / method.
116
- *
117
129
* Instead of \Magento\Webapi\Controller\Rest\InputParamsResolver
118
130
* we don't need to merge body params with url params and use only body params
119
131
*
0 commit comments