Reputation: 59978
I have a yaml file to generate my endpoints based on the OpenAPI principle, but when I open my swagger-ui I see:
openapi: 3.0.2
info:
....
....
paths:
/cities:
get:
tags:
- Cities
summary: Get all cities
operationId: getAllCities
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/City'
404:
description: Cities not found
content: {}
and the swagger config look like this:
@Configuration
@EnableSwagger2
public class Swagger2Config {
public static final String REST_PACKAGE = "package";
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage(REST_PACKAGE))
.paths(PathSelectors.any())
.build();
}
}
What I'm missing to remove cities-api-controller from swagger ui ?
Upvotes: 0
Views: 877
Reputation: 123
public class Swagger2Config {
public static final String REST_PACKAGE = "package";
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage(REST_PACKAGE))
.paths(regex("/*.*"))
.build();
}
}
Upvotes: 1