昂首阔步2+;spring集成
我正试图用Spring集成来公开RESTAPI,并用swagger来记录它。有可能吗?我找不到任何文件或例子,使它的工作 我的大摇大摆的菜豆:昂首阔步2+;spring集成,spring,spring-boot,spring-integration,swagger,Spring,Spring Boot,Spring Integration,Swagger,我正试图用Spring集成来公开RESTAPI,并用swagger来记录它。有可能吗?我找不到任何文件或例子,使它的工作 我的大摇大摆的菜豆: Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build(); 和简单流程: @Bean public IntegrationFlow inbound(
Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
和简单流程:
@Bean
public IntegrationFlow inbound() {
return IntegrationFlows.from(Http.inboundGateway("/foo")
.requestMapping(m -> m.methods(HttpMethod.GET))
.requestPayloadType(String.class))
.channel("httpRequest")
.get();
}
我使用SpringBoot:2.0.1和springfox-swagger2:2.8.0
提前感谢,,
Mateusz这是我的示例代码 Maven
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
</dependency>
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any())
.paths(PathSelectors.ant("/open/api/**")).build();
}
}
springfox目前不支持Spring集成,尽管他们提供了一个基于IntegrationRequestMappingHandlerMapping的泛化,似乎使之成为可能: 他们要求一份PR来实现这一点:
我看不出有什么不同,除了路径和招摇版本。它应该与spring集成一起工作吗?这个招摇过市的人做什么?从Spring集成的角度来看,可能没有这样的元数据可以让它正常工作?