diff --git a/src/ApiFactory.php b/src/ApiFactory.php index e8cf9e9..106164c 100644 --- a/src/ApiFactory.php +++ b/src/ApiFactory.php @@ -223,6 +223,11 @@ public function createService(Api $api, $serviceName) $op->setHttpMethod($httpMethod); if ($isRest) { + $identifier = isset($docsArray[$serviceClassName]['collection'][$httpMethod]['identifier']) + ? $docsArray[$serviceClassName]['collection'][$httpMethod]['identifier'] + : ''; + $op->setIdentifier($identifier); + $description = isset($docsArray[$serviceClassName]['collection'][$httpMethod]['description']) ? $docsArray[$serviceClassName]['collection'][$httpMethod]['description'] : ''; @@ -253,6 +258,11 @@ public function createService(Api $api, $serviceName) } if ($isRpc) { + $identifier = isset($docsArray[$serviceClassName][$httpMethod]['identifier']) + ? $docsArray[$serviceClassName][$httpMethod]['identifier'] + : ''; + $op->setIdentifier($identifier); + $description = isset($docsArray[$serviceClassName][$httpMethod]['description']) ? $docsArray[$serviceClassName][$httpMethod]['description'] : ''; @@ -293,6 +303,11 @@ public function createService(Api $api, $serviceName) $op = new Operation(); $op->setHttpMethod($httpMethod); + $identifier = isset($docsArray[$serviceClassName]['entity'][$httpMethod]['identifier']) + ? $docsArray[$serviceClassName]['entity'][$httpMethod]['identifier'] + : ''; + $op->setIdentifier($identifier); + $description = isset($docsArray[$serviceClassName]['entity'][$httpMethod]['description']) ? $docsArray[$serviceClassName]['entity'][$httpMethod]['description'] : ''; diff --git a/src/Operation.php b/src/Operation.php index 2b0b03a..30b6443 100644 --- a/src/Operation.php +++ b/src/Operation.php @@ -16,6 +16,11 @@ class Operation implements IteratorAggregate */ protected $httpMethod; + /** + * @var string + */ + protected $identifier; + /** * @var string */ @@ -61,6 +66,22 @@ public function getHttpMethod() return $this->httpMethod; } + /** + * @param string $identifier + */ + public function setIdentifier($identifier) + { + $this->identifier = $identifier; + } + + /** + * @return string + */ + public function getIdentifier() + { + return $this->identifier; + } + /** * @param string $description */ @@ -149,6 +170,7 @@ public function getResponseStatusCodes() public function toArray() { return [ + 'identifier' => $this->identifier, 'description' => $this->description, 'request' => $this->requestDescription, 'requires_authorization' => $this->requiresAuthorization,