Advertisement

SpringMVC和Swagger2隐藏方法

阅读量:

今日在编写接口时,依照网络上的教学资料进行操作,采用SpringMVC结合Swagger2的方案,发现虽然能够访问到swagger-ui.html页面,但接口方法却未能正常展示。
后来发现是未添加扫描包的注解@ComponentScan。
参考资料:https://www.jianshu.com/p/c4aa20052116
以下是相关代码:

复制代码
    package com.charbel.api;
    
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.ComponentScan;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.web.servlet.config.annotation.EnableWebMvc;
    import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
    import springfox.documenta

全部评论 (0)

还没有任何评论哟~