Hi Thilini,

You can add a plugin in plugins section to remove these components.

Ex:
function {
            return {
                components: {
                    Models: function() { return null },
                    schemes: function() { return null },
                    authorizeBtn: function() { return null },
                    info: function() { return null }
                }
            }
        }

Other than that you need to remove the layout: "StandaloneLayout" and
SwaggerUIStandalonePreset to get rid of the swagger ui header. At the end
SwaggerUiBunlde init should look like this.

const ui = SwaggerUIBundle({
    url: "<%=swaggerAPI%>",
    dom_id: '#swagger-ui-container',
    presets: [
        SwaggerUIBundle.presets.apis
    ],
    plugins: [
        function {
            return {
                components: {
                    Models: function() { return null },
                    schemes: function() { return null },
                    authorizeBtn: function() { return null },
                    info: function() { return null }
                }
            }
        }

    ]
})
window.ui = ui



Thanks,
Praminda

On Wed, Dec 6, 2017 at 9:19 AM, Thilini Shanika <thili...@wso2.com> wrote:

> Hi,
>
> We are currently in the process of upgrading swagger-ui 3.x in API Manager
> and we need to disable some of the components shipped with default swagger
> UI. Basically, we need to disable the components like top bar, API
> information, authorization button, schemas and models at the bottom of the
> swagger console. Is it possible to disable them?  We used following code
> snippet to embed swagger UI into the API detail page and what are the
> changes to be applied in order to disable above-mentioned components?
>
>   const ui = SwaggerUIBundle({
>       url: "<%=swaggerAPI%>",
>
>       dom_id: '#swagger-ui-container',
>       presets: [
>         SwaggerUIBundle.presets.apis,
>         SwaggerUIStandalonePreset
>       ],
>       plugins: [
>         SwaggerUIBundle.plugins.DownloadUrl
>       ],
>       layout: "StandaloneLayout"
>     })
>     window.ui = ui
>
>
> --
> Thilini Shanika
> Senior Software Engineer
> WSO2, Inc.; http://wso2.com
> 20, Palmgrove Avenue, Colombo 3
>
> E-mail: tgtshan...@gmail.com
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Praminda Jayawardana*
Software Engineer
WSO2 Inc.; http://wso2.com
Mobile : +94 (0) 716 590918
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to