Skip to content

Commit 6412ad0

Browse files
committed
Merge remote-tracking branch 'bulk/bulk-api-backport' into bulk-api-backported
2 parents 617dfba + 7a57a6f commit 6412ad0

File tree

1 file changed

+58
-32
lines changed
  • app/code/Magento/Webapi/Controller

1 file changed

+58
-32
lines changed

app/code/Magento/Webapi/Controller/Rest.php

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
156156
* @param \Magento\Framework\App\AreaList $areaList
157157
* @param FieldsFilter $fieldsFilter
158158
* @param ParamsOverrider $paramsOverrider
159+
* @param ServiceOutputProcessor $serviceOutputProcessor
160+
* @param Generator $swaggerGenerator ,
159161
* @param StoreManagerInterface $storeManager
160162
*
161163
* TODO: Consider removal of warning suppression
@@ -196,6 +198,32 @@ public function __construct(
196198
$this->requestProcessorPool = $this->_objectManager->get(RequestProcessorPool::class);
197199
}
198200

201+
/**
202+
* Get deployment config
203+
*
204+
* @return DeploymentConfig
205+
*/
206+
private function getDeploymentConfig()
207+
{
208+
if (!$this->deploymentConfig instanceof \Magento\Framework\App\DeploymentConfig) {
209+
$this->deploymentConfig = \Magento\Framework\App\ObjectManager::getInstance()
210+
->get(\Magento\Framework\App\DeploymentConfig::class);
211+
}
212+
return $this->deploymentConfig;
213+
}
214+
215+
/**
216+
* Set deployment config
217+
*
218+
* @param \Magento\Framework\App\DeploymentConfig $deploymentConfig
219+
* @return void
220+
* @deprecated 100.1.0
221+
*/
222+
public function setDeploymentConfig(\Magento\Framework\App\DeploymentConfig $deploymentConfig)
223+
{
224+
$this->deploymentConfig = $deploymentConfig;
225+
}
226+
199227
/**
200228
* Handle REST request
201229
*
@@ -238,7 +266,7 @@ protected function isSchemaRequest()
238266
*
239267
* @return Route
240268
* @deprecated 100.1.0
241-
* @see Magento\Webapi\Controller\Rest\InputParamsResolver::getRoute
269+
* @see \Magento\Webapi\Controller\Rest\InputParamsResolver::getRoute
242270
*/
243271
protected function getCurrentRoute()
244272
{
@@ -267,33 +295,10 @@ protected function checkPermissions()
267295
}
268296
}
269297

270-
/**
271-
* Validate request
272-
*
273-
* @throws AuthorizationException
274-
* @throws \Magento\Framework\Webapi\Exception
275-
* @return void
276-
* @deprecated 100.1.0
277-
* @see Magento\Webapi\Controller\Rest\RequestValidator::validate
278-
*/
279-
protected function validateRequest()
280-
{
281-
$this->checkPermissions();
282-
if ($this->getCurrentRoute()->isSecure() && !$this->_request->isSecure()) {
283-
throw new \Magento\Framework\Webapi\Exception(__('Operation allowed only in HTTPS'));
284-
}
285-
if ($this->storeManager->getStore()->getCode() === Store::ADMIN_CODE
286-
&& strtoupper($this->_request->getMethod()) === RestRequest::HTTP_METHOD_GET
287-
) {
288-
throw new \Magento\Framework\Webapi\Exception(__('Cannot perform GET operation with store code \'all\''));
289-
}
290-
}
291-
292298
/**
293299
* Execute schema request
294300
*
295301
* @return void
296-
* @deprecated 100.1.0
297302
*/
298303
protected function processSchemaRequest()
299304
{
@@ -314,7 +319,6 @@ protected function processSchemaRequest()
314319
* Execute API request
315320
*
316321
* @return void
317-
* @deprecated 100.1.0
318322
* @throws AuthorizationException
319323
* @throws \Magento\Framework\Exception\InputException
320324
* @throws \Magento\Framework\Webapi\Exception
@@ -346,18 +350,40 @@ protected function processApiRequest()
346350
}
347351

348352
/**
349-
* Get deployment config
353+
* Validate request
350354
*
351-
* @return DeploymentConfig
355+
* @throws AuthorizationException
356+
* @throws \Magento\Framework\Webapi\Exception
357+
* @return void
352358
* @deprecated 100.1.0
359+
* @see \Magento\Webapi\Controller\Rest\RequestValidator::validate
353360
*/
354-
private function getDeploymentConfig()
361+
protected function validateRequest()
355362
{
356-
if (!$this->deploymentConfig instanceof \Magento\Framework\App\DeploymentConfig) {
357-
$this->deploymentConfig = \Magento\Framework\App\ObjectManager::getInstance()
358-
->get(\Magento\Framework\App\DeploymentConfig::class);
363+
$this->checkPermissions();
364+
if ($this->getCurrentRoute()->isSecure() && !$this->_request->isSecure()) {
365+
throw new \Magento\Framework\Webapi\Exception(__('Operation allowed only in HTTPS'));
366+
}
367+
if ($this->storeManager->getStore()->getCode() === Store::ADMIN_CODE
368+
&& strtoupper($this->_request->getMethod()) === RestRequest::HTTP_METHOD_GET
369+
) {
370+
throw new \Magento\Framework\Webapi\Exception(__('Cannot perform GET operation with store code \'all\''));
359371
}
360-
return $this->deploymentConfig;
361372
}
362373

374+
/**
375+
* The getter function to get InputParamsResolver object
376+
*
377+
* @return \Magento\Webapi\Controller\Rest\InputParamsResolver
378+
*
379+
* @deprecated 100.1.0
380+
*/
381+
private function getInputParamsResolver()
382+
{
383+
if ($this->inputParamsResolver === null) {
384+
$this->inputParamsResolver = \Magento\Framework\App\ObjectManager::getInstance()
385+
->get(\Magento\Webapi\Controller\Rest\InputParamsResolver::class);
386+
}
387+
return $this->inputParamsResolver;
388+
}
363389
}

0 commit comments

Comments
 (0)