Hi,
I understand that when deploying the flowable-rest.war, I can the the swagger-ui.
I am using flowable-spring-boot-starter-rest-api and not flowable-rest.war
How can I see the swagger-ui? Should I add a swagger dependency on the pom or another way?
Thanks,
for creating your own swagger add below dependencies, and create config file that points to your rest controller
Dependencies:
url --> https://mvnrepository.com/artifact/io.springfox/springfox-swagger2
groupId–>io.springfox
artifactId–>springfox-swagger2
version–>2.6.1
scope–>compile
url --> https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui
groupId–>io.springfox
artifactId–>springfox-swagger-ui
version–>2.6.1
scope–>compile
and create config file as below:
@EnableSwagger2
@Configuration
public class SwaggerConfig extends WebSecurityConfigurerAdapter{
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage(“com.abc.proj”))
.paths(regex("/proj-rest.*"))
.build()
.apiInfo(metaInfo());
}
private ApiInfo metaInfo() {
ApiInfo apiInfo = new ApiInfo(
Rest API",
"Spring Boot Swagger REST API ",
"1.0",
"Terms of Service",
new Contact("ABC Team", "http://wwww.abc.com",
"vzy@abc.com"),
"Apache License Version 2.0",
"https://www.apache.org/licesen.html"
);
return apiInfo;
}
I have accepted the answer, though a much smaller SpringBoot configuration did the trick:
@EnableSwagger2
@Profile(“dev”)
@Configuration
public class SwaggerConfig {
}