We use Swagger and Spring Fox version 2.5.0, the POM entry below. When we create a Spring MVC controller that uses a parameter map (see the example below), the Swagger-UI page is not generated properly. The controller in question is not displayed on the Swagger-UI page, and none of the controllers that appear after it are also displayed (in alphabetical order).
@RequestMapping(value = "/resource/", method = RequestMethod.GET, produces = {"application/json"}) public void get(@RequestParam MultiValueMap<String, String> params) {
When the parameter map is deleted, everything is in order. Any idea what could be the problem or how to get around it?
The following is additional information that may or may not be useful.
dependencies:
<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.5.0</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.5.0</version> </dependency>
Swagger Configuration:
@Configuration @EnableSwagger2 public class SwaggerConfiguration { @Bean public Docket api() { Docket docket = new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .paths(PathSelectors.any()) .build(); docket.ignoredParameterTypes(Principal.class); return docket; } private ApiInfo apiInfo() { return new ApiInfoBuilder().title("some app") .description("some description") .build(); } }
source share