swagger = $swagger; } /** * Display the documentation * * @return JsonModel */ public function displayAction() { $jsonModel = new JsonModel((array)$this->swagger->jsonSerialize()); return $jsonModel; } /** * Get the details of a resource * * @return JsonModel */ public function detailsAction() { /** @var $options \SwaggerModule\Options\ModuleOptions */ $options = $this->serviceLocator->get('SwaggerModule\Options\ModuleOptions'); $resourceOptions = $options->getResourceOptions() ? : array(); $resource = $this->swagger->getResource('/' . $this->params('resource', null), $resourceOptions); if ($resource === false) { return new JsonModel(); } $jsonModel = new JsonModel(); return $jsonModel->setVariables($resource); } }