public function doIndex() { $resourceListing = new ResourceListing('1.0'); $resources = $this->resourceListing->getResourceIndex(); foreach ($resources as $resource) { $path = '/*'; $path .= ApiGeneration::transformRoutePlaceholder($resource->getPath()); $resourceListing->addResource(new ResourceObject($path)); } $this->setBody($resourceListing, WriterInterface::JSON); }
protected function getRoutings() { $routings = array(); $resources = $this->resourceListing->getResourceIndex(); foreach ($resources as $resource) { $routings[] = new Record('routing', ['path' => $resource->getPath(), 'methods' => $resource->getAllowedMethods(), 'version' => '*']); } return $routings; }