public function ApiSpecificationController::getSpecification in OpenAPI 8
Same name and namespace in other branches
- 8.2 src/Controller/ApiSpecificationController.php \Drupal\openapi\Controller\ApiSpecificationController::getSpecification()
Gets the OpenAPI output in JSON format.
Return value
\Symfony\Component\HttpFoundation\JsonResponse The JSON response.
1 string reference to 'ApiSpecificationController::getSpecification'
File
- src/
Controller/ ApiSpecificationController.php, line 36
Class
- ApiSpecificationController
- API Specification controller base.
Namespace
Drupal\openapi\ControllerCode
public function getSpecification(OpenApiGeneratorInterface $openapi_generator, Request $request) {
$options = $request
->get('options', []);
$openapi_generator
->setOptions($options);
$spec = $openapi_generator
->getSpecification();
return new JsonResponse($spec);
}