若依升级到springboot3后swagger3出现的问题
按照文档将若依从jdk8升级到17,springboot从2升级到3,发现swagger用不了了。文档中修改SecurityConfig.java,以支持Spring Security6新的配置方式。swagger3的界面在/swagger-ui/index.html。导致被拦截掉。另外可能需要改个.headers(headers -> headers.frameOptions().disable())。否则会导致iframe页面无法渲染。不过我不明白为什么我按照 .requestMatchers("/swagger-ui/", "/swagger-resources/", "/webjars/", "//api-docs", "//api-docs/", "/druid/","/v3/"
,"/swagger-ui.html/**","/error").permitAll()配置了匿名请求,但是swagger却报Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually。