Why does the springfox-swagger2 user interface tell me which is not possible Unable to infer base url.As far as I know, I am using the typical spring loaded Swagger configuration.
As you can see in the screenshot, the swagger-fox URL that supports the user interface is example.com/api . NOTE. I get the standard Whitelabel Error PageSpring Whitelabel Error Pagewhen navigating to : https: // localhost: 9600 / api / v2 / api-docs / . I suspect this is the root of the problem? I see no errors in the fact that Spring did not load springfox-swagger2and therefore I do not know why this does not work.

( , ):
@EnableSwagger2
@EnableWebMvc
@ComponentScan(basePackages = {"com.company.project"})
public class SwaggerConfig
{
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.boot")))
.apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.cloud")))
.apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.data.rest.webmvc")))
.paths(PathSelectors.any())
.build();
}
}
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
: , 2.6.0, , Swagger UI 0 api. , , ?
, .