## swagger2使用 ### pom.xml添加依赖 ``` com.spring4all swagger-spring-boot-starter 1.9.0.RELEASE ``` ### 应用主类中添加@EnableSwagger2Doc注解 ``` @EnableSwagger2Doc @SpringBootApplication public class Chapter22Application { public static void main(String[] args) { SpringApplication.run(Chapter22Application.class, args); } } ``` ### application.properties中配置文档相关内容,比如 swagger.title=spring-boot-starter-swagger swagger.description=Starter for swagger 2.x swagger.version=1.4.0.RELEASE swagger.license=Apache License, Version 2.0 swagger.licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.html swagger.termsOfServiceUrl=https://github.com/dyc87112/spring-boot-starter-swagger swagger.contact.name=didi swagger.contact.url=http://blog.didispace.com swagger.contact.email=dyc87112@qq.com swagger.base-package=com.didispace swagger.base-path=/**