You are here

function swagger_ui_formatter_libraries_info in Swagger UI Field Formatter 7.2

Implements hook_libraries_info().

For defining swagger ui 3.0 libraries.

File

./swagger_ui_formatter.module, line 104
Swagger ui field formatter functionality.

Code

function swagger_ui_formatter_libraries_info() {
  $libraries['swagger_ui'] = array(
    'name' => 'Swagger UI',
    'vendor url' => 'https://swagger.io/swagger-ui',
    'download url' => 'https://github.com/swagger-api/swagger-ui/releases',
    'version arguments' => array(
      'file' => 'package.json',
      'pattern' => '@"version":\\s+"([0-9\\.-]+)@',
      'lines' => 3,
    ),
    'path' => 'dist',
    'integration files' => array(
      'swagger_ui_formatter' => array(
        'js' => array(
          'swagger_ui_formatter.js',
        ),
      ),
    ),
    'files' => array(
      'js' => array(
        'swagger-ui-bundle.js' => array(
          'type' => 'file',
          'group' => JS_LIBRARY,
          'preprocess' => FALSE,
          'weight' => 1,
        ),
        'swagger-ui-standalone-preset.js' => array(
          'type' => 'file',
          'group' => JS_LIBRARY,
          'preprocess' => FALSE,
          'weight' => 1,
        ),
      ),
      'css' => array(
        'swagger-ui.css',
      ),
    ),
  );
  return $libraries;
}