i activated the rest-api-addon in our cuba-project. The plugin is working as far as i can tell.
I’m trying to integrate the swagger-ui into the project, but i can’t get it to work.
Could you hint me as to how i could enable it?
I added
compile ‘io.springfox:springfox-swagger-ui:2.9.2’
to our build.gradle and some configuration to the web-dispatcher-spring.xml
but it seems i still can’t access the swagger-ui.html
We are currently working with CUBA Version 7.2.4
You can use the below snippet and it worked for me
@EnableSwagger2
@PropertySource("classpath:/com/company/vp/swagger.properties")
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.company.vp.web.controllers"))
.paths(PathSelectors.any())
.build();
}
}
thank you for your response. I tried this exactly, but somehow i can’t access the swagger-ui.html.
How would i access the site?
I think it should be at http://localhost:8080/app/swagger-ui.html
or http://localhost:8080/swagger-ui.html
On the first link i get redirected to the login-screen of our app and on the second i get a 404-Error.
I think im missing something obvious here.
The part http://localhost:8080/app should be obviously the path to your application.
The “dispatch” is the path you configured in your rest-dispatcher-spring.xml