From 4030a7593fd2685fcad101fdcbd34eaee163c300 Mon Sep 17 00:00:00 2001 From: Gary Gitton Date: Tue, 31 Jul 2018 06:14:40 +0200 Subject: [PATCH 1/4] add operation id to documentation --- src/Service.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Service.php b/src/Service.php index 9c60ca4..40936cc 100644 --- a/src/Service.php +++ b/src/Service.php @@ -261,6 +261,7 @@ private function getPathOperation(Operation $operation, $parameters) { return $this->cleanEmptyValues([ 'tags' => [$this->service->getName()], + 'operationId' => $operation->getOperationId(), 'description' => $operation->getDescription(), 'parameters' => $parameters, 'produces' => $this->service->getRequestAcceptTypes(), From 731c675afd45adab1d51fbf867fc2ac66e17edc9 Mon Sep 17 00:00:00 2001 From: Gary Gitton Date: Fri, 14 Sep 2018 16:37:55 +0200 Subject: [PATCH 2/4] update method used to get identifier --- src/Service.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service.php b/src/Service.php index 40936cc..0f6001b 100644 --- a/src/Service.php +++ b/src/Service.php @@ -261,7 +261,7 @@ private function getPathOperation(Operation $operation, $parameters) { return $this->cleanEmptyValues([ 'tags' => [$this->service->getName()], - 'operationId' => $operation->getOperationId(), + 'operationId' => $operation->getIdentifier(), 'description' => $operation->getDescription(), 'parameters' => $parameters, 'produces' => $this->service->getRequestAcceptTypes(), From 77e33caf1b44adb4948b20c3c4d55f3d8dbaeb7b Mon Sep 17 00:00:00 2001 From: Gary Gitton Date: Mon, 17 Sep 2018 23:31:09 +0200 Subject: [PATCH 3/4] add identifier and operation in tests --- test/TestAsset/fixtures/swagger2.json | 2 ++ test/TestAsset/module-config/documentation.config.php | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/test/TestAsset/fixtures/swagger2.json b/test/TestAsset/fixtures/swagger2.json index 52384b9..9b7373f 100644 --- a/test/TestAsset/fixtures/swagger2.json +++ b/test/TestAsset/fixtures/swagger2.json @@ -283,6 +283,7 @@ }, "/foo-bar": { "get": { + "operationId": "listFooBar", "tags": ["FooBar"], "description": "Collection FooBar GET!", "produces": [ @@ -759,6 +760,7 @@ }, "/ping": { "get": { + "operationId": "ping", "tags": ["Ping"], "description": "Ping the API to see uptime and network lag", "produces": [ diff --git a/test/TestAsset/module-config/documentation.config.php b/test/TestAsset/module-config/documentation.config.php index 3e862d3..9f86db9 100644 --- a/test/TestAsset/module-config/documentation.config.php +++ b/test/TestAsset/module-config/documentation.config.php @@ -8,6 +8,7 @@ 'Test\\V1\\Rest\\FooBar\\Controller' => [ 'collection' => [ 'GET' => [ + 'identifier' => 'listFooBar', 'description' => 'Collection FooBar GET!', 'request' => null, 'response' => '{ @@ -44,6 +45,7 @@ }', ], 'POST' => [ + 'identifier' => null, 'description' => null, 'request' => '{ "goober": "Example goober value", @@ -55,21 +57,25 @@ ], 'entity' => [ 'GET' => [ + 'identifier' => null, 'description' => null, 'request' => null, 'response' => null, ], 'PATCH' => [ + 'identifier' => null, 'description' => null, 'request' => null, 'response' => null, ], 'PUT' => [ + 'identifier' => null, 'description' => null, 'request' => null, 'response' => null, ], 'DELETE' => [ + 'identifier' => null, 'description' => null, 'request' => null, 'response' => null, @@ -83,6 +89,7 @@ ], 'Test\\V1\\Rpc\\Ping\\Controller' => [ 'GET' => [ + 'identifier' => 'ping', 'description' => 'Ping the API to see uptime and network lag', 'request' => null, 'response' => '{"ack": 123456789}', From b2a11472bc3cb5a2178d338603807070e40417be Mon Sep 17 00:00:00 2001 From: Gary Gitton Date: Mon, 17 Sep 2018 23:31:24 +0200 Subject: [PATCH 4/4] change version in swagger example for test --- test/TestAsset/fixtures/swagger2.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TestAsset/fixtures/swagger2.json b/test/TestAsset/fixtures/swagger2.json index 9b7373f..ffd5c92 100644 --- a/test/TestAsset/fixtures/swagger2.json +++ b/test/TestAsset/fixtures/swagger2.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Test", - "version": "1.0" + "version": "1" }, "tags": [{ "name": "BooBaz"