SwaggerUiExpander

Expands:

$componentRoot.directory$/$artifactSubFolders$/$component.name$-swagger.html

if:

component.getOption('enableJaxrs').defined
    and component.getOption('enableSwagger').defined and
    (new net.democritus.expander.rest.helper.RestApplicationApiHelper()).isMainApiComponent(component)
property value
element type Component
qualified name net.democritus.expander.rest.swagger.SwaggerUiExpander
layer VIEW_LAYER
technology JAXRS
sourceType HTML
phase expansion
features  

Example

Some example of the content generated by the expander:

<!-- expanded with nsx-expanders:4.16.3, expansionResource net.democritus:rest-expanders:2.4.2 -->
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>RestDemo API Documentation</title>
    <link rel="stylesheet" type="text/css" href="../css/swagger-ui.css" >
    <link rel="icon" type="image/png" href="../images/swagger-ui-favicon-32x32.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="../images/swagger-ui-favicon-16x16.png" sizes="16x16" />
    <style>
      html
      {
        box-sizing: border-box;
        overflow: -moz-scrollbars-vertical;
        overflow-y: scroll;
      }

      *,
      *:before,
      *:after
      {
        box-sizing: inherit;
      }

      body
      {
        margin:0;
        background: #fafafa;
      }
    </style>
  </head>

  <body>
    <div id="swagger-ui"></div>

    <script src="../js/swagger-ui-bundle.js"> </script>
    <script src="../js/swagger-ui-standalone-preset.js"> </script>
    <script>
    window.onload = function() {
      var getUrl = window.location;
      var baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1] + "/v1/swagger.json";
      var oauth2RedirectUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1] + "/html/swagger-oauth2-redirect.html";

      // @anchor:before-setup:start
      // @anchor:before-setup:end
      // anchor:custom-before-setup:start
      // anchor:custom-before-setup:end

      // Begin Swagger UI call region
      const ui = SwaggerUIBundle({
        url: baseUrl,
        dom_id: '#swagger-ui',
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset.slice(1),
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout",
        oauth2RedirectUrl: oauth2RedirectUrl
        // @anchor:config:start
        // @anchor:config:end
        // anchor:custom-config:start
        // anchor:custom-config:end
      })
      // End Swagger UI call region

      // @anchor:after-setup:start
      // @anchor:after-setup:end
      // anchor:custom-after-setup:start
      // anchor:custom-after-setup:end

      window.ui = ui
    }
  </script>
  </body>
</html>

These expanders have the same isApplicable as SwaggerUiExpander.

These features have the same condition as SwaggerUiExpander.