<?php
$breadcrumbs = [
  ['label' => t('Home'), 'path' => 'admin'],
  ['label' => t('API docs')],
];
$specUrl = lurl('admin/api-docs/spec');
require templatePath('partials/app-breadcrumb.phtml');
?>

<div class="app-swagger-container">
  <div id="swagger-ui"></div>
</div>

<script src="<?php e(asset('vendor/swagger-ui/swagger-ui-bundle.js')); ?>"></script>
<script>
  window.addEventListener('DOMContentLoaded', function () {
    if (!window.SwaggerUIBundle) {
      return;
    }

    window.SwaggerUIBundle({
      url: '<?php e($specUrl); ?>',
      dom_id: '#swagger-ui',
      deepLinking: false,
      displayRequestDuration: true,
      filter: true,
      docExpansion: 'list',
      supportedSubmitMethods: [],
      tryItOutEnabled: false,
      presets: [
        window.SwaggerUIBundle.presets.apis,
      ],
      layout: 'BaseLayout'
    });
  });
</script>
