Пожалуйста, найдите детали конфигурации.
Пружинное приложение
Зависимость
//swagger for api documentation
compile('io.springfox:springfox-swagger2:2.9.2')
compile('io.springfox:springfox-swagger-ui:2.9.2')
Код
@EnableSwagger2
@ComponentScan(basePackages = "com.myntra.catalog.service")
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build().apiInfo(apiEndPointsInfo());
}
private ApiInfo apiEndPointsInfo() {
return new ApiInfoBuilder().title("Spring REST APIs")
.description("Catalog Service APIs")
.license("Apache 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.version("1.0.0")
.build();
}
}
Получение этого журнала в сборке 05:35:54.998 INFO springfox.documentation.spring.web.PropertySourcedRequestMappingHandlerMapping [RMI TCP Connection(2)-127.0.0.1] - Mapped URL path [/v2/api-docs] onto method [public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)]
Но ** / v2 / api-docs дает 404 **
Получение вышеуказанной ошибки. Может кто-нибудь, пожалуйста, помогите здесь.