-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.module
More file actions
34 lines (30 loc) · 1.11 KB
/
swagger.module
File metadata and controls
34 lines (30 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* @file
* Swagger module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function swagger_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.swagger':
$output = '';
$output .= '<h3>' . t('About Swagger') . '</h3>';
$output .= '<p><a href="http://swagger.io/" target="_blank">Swagger </a>' . t('is a powerful open source framework backed by a large ecosystem of tools that helps you design, build, document, and consume your RESTful APIs.') . '</p>';
$output .= '<p>' . t('The Swagger Drupal module allows your to describe your API using a specific JSON schema that outlines the names, order, and other details of the API.') . '</p>';
$output .= '<p>' . t('The purpose of the module is to generate a json file that can be read and interpreted by <a href="http://swagger.io/swagger-ui/" target="_blank">Swagger UI</a>.') . '</p>';
return $output;
}
}
/**
* Implements hook_theme().
*/
function swagger_theme() {
return [
'swagger_ui' => [
'render element' => 'elements',
],
];
}