@Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2).select() .apis(RequestHandlerSelectors.basePackage("report.controller")) .paths(PathSelectors.any()).build(); } }
NOTE
If you use fastjson serialization, the fastjson version must be 1.2.10 or higher