Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

add operation id to documentation #37

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ private function getPathOperation(Operation $operation, $parameters)
{
return $this->cleanEmptyValues([
'tags' => [$this->service->getName()],
'operationId' => $operation->getIdentifier(),
'description' => $operation->getDescription(),
'parameters' => $parameters,
'produces' => $this->service->getRequestAcceptTypes(),
Expand Down
4 changes: 3 additions & 1 deletion test/TestAsset/fixtures/swagger2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"swagger": "2.0",
"info": {
"title": "Test",
"version": "1.0"
"version": "1"
},
"tags": [{
"name": "BooBaz"
Expand Down Expand Up @@ -283,6 +283,7 @@
},
"/foo-bar": {
"get": {
"operationId": "listFooBar",
"tags": ["FooBar"],
"description": "Collection FooBar GET!",
"produces": [
Expand Down Expand Up @@ -759,6 +760,7 @@
},
"/ping": {
"get": {
"operationId": "ping",
"tags": ["Ping"],
"description": "Ping the API to see uptime and network lag",
"produces": [
Expand Down
7 changes: 7 additions & 0 deletions test/TestAsset/module-config/documentation.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'Test\\V1\\Rest\\FooBar\\Controller' => [
'collection' => [
'GET' => [
'identifier' => 'listFooBar',
'description' => 'Collection FooBar GET!',
'request' => null,
'response' => '{
Expand Down Expand Up @@ -44,6 +45,7 @@
}',
],
'POST' => [
'identifier' => null,
'description' => null,
'request' => '{
"goober": "Example goober value",
Expand All @@ -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,
Expand All @@ -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}',
Expand Down