Spring boot integrates Swagger2

@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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326834981&siteId=291194637