All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.swagger-ui.restdoc.js.restdoc.js Maven / Gradle / Ivy

There is a newer version: 0.2.1.4
Show newest version

function configUI(baseUrl) {
    $.ajax({
        url: baseUrl + "/swaggerUIConfiguration",
        dataType: "json",
        success: function( result ) {
           window.ui = SwaggerUIBundle({
               url: "../swagger.json",
               dom_id: '#swagger-ui',
               deepLinking: result.deepLinking,
               displayOperationId: result.displayOperationId,

               docExpansion: result.docExpansion,
               defaultModelsExpandDepth: result.defaultModelsExpandDepth,
               defaultModelExpandDepth: result.defaultModelExpandDepth,
               maxDisplayedTags: result.maxDisplayedTags,
               showExtensions: result.showExtensions,
               showCommonExtensions: result.showCommonExtensions,
               defaultModelRendering: result.defaultModelRendering,
               displayRequestDuration: result.displayRequestDuration,

               presets: [
                   SwaggerUIBundle.presets.apis,
                   SwaggerUIStandalonePreset
               ],
               plugins: [
                   SwaggerUIBundle.plugins.DownloadUrl
               ],
               layout: result.layout
           })
        }
    });
}

function getBaseUrl() {
    var urlMatches = /(.*)\/swagger-ui\/index.html.*/.exec(window.location.href);
    return urlMatches[1];
}

console.log(getBaseUrl());

window.onload = function () {
    configUI(getBaseUrl());
}








© 2015 - 2025 Weber Informatics LLC | Privacy Policy