Search code examples
spring-bootdockerdockerfileswagger-uiazure-aks

Swagger UI page showing invalid image


Swagger UI is showing below node image at bottom of the page. Why ? How this can be removed or hidden. We are using spring boot rest api.

 <span style="float: right;"><a target="_blank" href="https://online.swagger.io/validator/debug?url=<some DNS>/swagger/api-docs?group={some group info}"><img alt="Online validator badge" src="https://online.swagger.io/validator?url=<some DNS>/swagger/api-docs?group={some group info}"></a></span>

enter image description here

Getting this image after deploying docker into Azure Kubernetes Cluster. when I run an application on local hot then I don't get this issue.


Solution

  • Disabling validator using below code worked for me.

    @Bean
        UiConfiguration uiConfig() {
            return UiConfigurationBuilder.builder()
                .displayRequestDuration(true)
                .validatorUrl(null)
                .build();
        }