css - Dark theme in Swagger UI embedded in a JavaSpring Boot application - Stack Overflow

My Spring Boot application embeds Swagger UI. I would like to get a "Dark display" but I do n

My Spring Boot application embeds Swagger UI. I would like to get a "Dark display" but I do not succeed

I tried to do it via the following class:

@Configuration
public class SwaggerConfig {

    private final SwaggerUiConfigProperties swaggerUiConfig;

    @Autowired
    public SwaggerConfig(SwaggerUiConfigProperties swaggerUiConfig) {
        this.swaggerUiConfig = swaggerUiConfig;
    }

    @Bean
    public SwaggerUiConfigParameters swaggerUiConfigParameters() {
        SwaggerUiConfigParameters configParameters = new SwaggerUiConfigParameters(swaggerUiConfig);
        configParameters.setConfigUrl("/my-swagger-dark.css");

        return configParameters;
    }

}

I Placed my custom CSS in the resource directory src/main/resources/static/my-swagger-dark.css but when I try to connect to Swagger UI I get a strange page referencing a URL that is not handled by my software: .json

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744292885a4567117.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信