Why does springfox-swagger2 UI tell me “Unable to infer base url.”

前端 未结 13 899
醉话见心
醉话见心 2020-12-10 11:01

Why does springfox-swagger2 UI tell me Unable to infer base url. As far as I know, I am using a typical Swagger spring-boot configuration.

As you can

13条回答
  •  天涯浪人
    2020-12-10 11:43

    I needed to add anonymous access to resources in Spring Security method: protected void configure(HttpSecurity http)

    .antMatchers("/api/**", "/swagger-ui.html", "/webjars/**", "/v2/**", "/swagger-resources/**").anonymous()
    

    And then it starts working.

提交回复
热议问题