How do you turn off swagger-ui in production

前端 未结 6 1626
孤独总比滥情好
孤独总比滥情好 2021-01-31 14:46

I have swagger plugged in to my spring boot application. Spring boot allows you to have property files for each environment that you have. Is there a way to disable swagger fo

6条回答
  •  终归单人心
    2021-01-31 14:57

    If you are working on multiple environments then you can also use @Profile as array

    @Configuration
    @EnableSwagger2
    @Profile({"dev","qa"})
    public class SwaggerConfig {
       // your swagger configuration
    }
    

提交回复
热议问题