Springboot添加Swagger
Swagger
配置springfox-boot-starter
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${swagger.fox.version}</version>
</dependency>
Spring security配置过滤swagger相关请求
httpSecurity.csrf().disable().cors()
.and()
.authorizeRequests()
.antMatchers("/swagger-resources/**","/swagger-ui/**", "/v3/**", "/error").permitAll()
.anyRequest().authenticated()
前端报错404
request路径多了一个字母,肉眼看不出来,编辑器比对出来的
参考
Swagger3被拦截器拦截并报错Unable to infer base url或者Unable to render this definition_JSluck的博客-CSDN博客
正文到此结束
- 本文标签: Spring Boot
- 版权声明: 本站原创文章,于2023年08月24日由Zara发布,转载请注明出处