forked from loafle/openapi-generator-original
Update swaggerConfig.mustache with springfox-code-2.4.0
ApiInfo have a Builder in springfox version 2.4.0 see springfox.documentation.builders.ApiInfoBuilder nota String contact is deprecated use springfox.documentation.service (String name, String url, String email)
This commit is contained in:
@@ -7,6 +7,7 @@ import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@@ -22,15 +23,15 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
ApiInfo apiInfo() {
|
||||
ApiInfo apiInfo = new ApiInfo(
|
||||
"{{appName}}",
|
||||
"{{{appDescription}}}",
|
||||
"{{appVersion}}",
|
||||
"{{infoUrl}}",
|
||||
"{{infoEmail}}",
|
||||
"{{licenseInfo}}",
|
||||
"{{licenseUrl}}" );
|
||||
return apiInfo;
|
||||
return new ApiInfoBuilder()
|
||||
.title("{{appName}}")
|
||||
.description("{{{appDescription}}}")
|
||||
.license("{{licenseInfo}}")
|
||||
.licenseUrl("{{licenseUrl}}")
|
||||
.termsOfServiceUrl("{{infoUrl}}")
|
||||
.version("{{appVersion}}")
|
||||
.contact(new Contact("","", "{{infoEmail}}"))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -38,4 +39,4 @@ public class SwaggerConfig {
|
||||
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user