swagger UI not rendering some of the controllers in the api-docs.json

2,646 views
Skip to first unread message

a.r.gh...@gmail.com

unread,
Feb 7, 2016, 4:12:12 AM2/7/16
to Swagger
I'm using springfox-swagger-ui:2.3.1 with springfox-swagger2:2.3.1 in spring boot web application. all of my @RestController are identified in the /v2/api-docs JSON file but some of them are not shown in swagger-ui. this is my swagger config:

@Configuration
@EnableSwagger2
public class SwaggerConfig{
   
@Bean
   
public Docket api(){
       
return new Docket(DocumentationType.SWAGGER_2)
               
.select()
               
.apis(RequestHandlerSelectors.any())
               
.paths(PathSelectors.regex("/.*"))
               
.build()
               
.apiInfo(new ApiInfo(
                       
"My Project's REST API",
                       
"This is a description of your API.",
                       
"version 1.0.0",
                       
"API TOS",
                       
"m...@wherever.com",
                       
"API License",
                       
"API License URL"
               
));
   
}
}

and i've attached the json file(i've removed the controllers that are rendered in the UI for simplification).
does anyone know how to fix this issue? any tips for debugging is also welcome.
api-docs.json

a.r.gh...@gmail.com

unread,
Feb 10, 2016, 8:24:56 AM2/10/16
to Swagger
I noticed that the APIs that take a boolean argument cause this issue and it seems after one of these APIs are reached the rest of the APIs and controllers are ignored(alphabetically speaking). So does anyone know any workarounds or perhaps anyway to ignore those few APIs(ignore not hide, since hiding doesnt work)?
Reply all
Reply to author
Forward
0 new messages