Skip to content

Commit 9c8addb

Browse files
Oleksii KorshenkoCarey Sizer
Oleksii Korshenko
authored and
Carey Sizer
committed
MAGETWO-70495: Fix Swagger-generated operation parameter names for "body" parameters #7446
- fixed REST tests
1 parent cbf7c18 commit 9c8addb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ protected function getGeneralInfo()
204204
protected function generatePathInfo($methodName, $httpMethodData, $tagName)
205205
{
206206
$methodData = $httpMethodData[Converter::KEY_METHOD];
207-
$operationId = $this->typeProcessor->getOperationName($tagName, $methodData[Converter::KEY_METHOD]) . ucfirst($methodName);
207+
208+
$operationId = $this->typeProcessor->getOperationName($tagName, $methodData[Converter::KEY_METHOD]);
209+
$operationId .= ucfirst($methodName);
210+
208211
$pathInfo = [
209212
'tags' => [$tagName],
210213
'description' => $methodData['documentation'],

dev/tests/api-functional/testsuite/Magento/Webapi/JsonGenerationFromDataObjectTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use Magento\TestFramework\Helper\Bootstrap;
1212
use Magento\Framework\App\ProductMetadataInterface;
13+
use Magento\Store\Model\StoreManagerInterface;
1314

1415
/**
1516
* Test REST schema generation mechanisms.
@@ -34,10 +35,10 @@ protected function setUp()
3435
{
3536
$this->_markTestAsRestOnly("JSON generation tests are intended to be executed for REST adapter only.");
3637

37-
$this->storeCode = Bootstrap::getObjectManager()->get(\Magento\Store\Model\StoreManagerInterface::class)
38+
$this->storeCode = Bootstrap::getObjectManager()->get(StoreManagerInterface::class)
3839
->getStore()->getCode();
3940

40-
$this->productMetadata = Bootstrap::getObjectManager()->get(\Magento\Framework\App\ProductMetadataInterface::class);
41+
$this->productMetadata = Bootstrap::getObjectManager()->get(ProductMetadataInterface::class);
4142

4243
parent::setUp();
4344
}
@@ -197,7 +198,7 @@ public function getExpectedMultiServiceData()
197198
'required' => true
198199
],
199200
[
200-
'name' => '$body',
201+
'name' => 'testModule5AllSoapAndRestV1NestedUpdatePutBody',
201202
'in' => 'body',
202203
'schema' => [
203204
'required' => [

0 commit comments

Comments
 (0)