Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用swagger codegen禁用springfox_Java_Spring_Swagger_Swagger Codegen_Springfox - Fatal编程技术网

Java 使用swagger codegen禁用springfox

Java 使用swagger codegen禁用springfox,java,spring,swagger,swagger-codegen,springfox,Java,Spring,Swagger,Swagger Codegen,Springfox,我正在使用io.swagger.codegen.v3.swagger-codegen-maven-plugin版本3.0.18从openapi 3 yaml生成代码。但是,当它被生成时,它会创建一个带有swagger 2配置的springfox 我想除掉斯普林福克斯,但我不知道怎么做。我曾想过写一些属性,比如“springfox.enable=false”,但我什么也找不到 我不能使用Spring概要文件,因为生成的SwagggerDocumentationConfig类是在编译中创建的 我的插

我正在使用io.swagger.codegen.v3.swagger-codegen-maven-plugin版本3.0.18从openapi 3 yaml生成代码。但是,当它被生成时,它会创建一个带有swagger 2配置的springfox

我想除掉斯普林福克斯,但我不知道怎么做。我曾想过写一些属性,比如“springfox.enable=false”,但我什么也找不到

我不能使用Spring概要文件,因为生成的SwagggerDocumentationConfig类是在编译中创建的

我的插件配置:


${swagger codegen.api.spec}
春天
弹簧靴
${swagger codegen.server.api.package}
${swagger codegen.server.model.package}
真的
真的
杰克逊=真的
假的
假的
爪哇8
.
真的
真的
真的
我要禁用的类

包io.swagger.configuration;
导入org.springframework.context.annotation.Bean;
导入org.springframework.context.annotation.Configuration;
导入springfox.documentation.builders.ApiInfoBuilder;
导入springfox.documentation.builders.RequestHandlerSelectors;
导入springfox.documentation.service.apinfo;
导入springfox.documentation.service.Contact;
导入springfox.documentation.spi.DocumentationType;
导入springfox.documentation.spring.web.plugins.Docket;
@javax.annotation.Generated(value=“io.swagger.codegen.v3.generators.java.SpringCodegen”,date=“2020-03-19T11:38:32.945+01:00[欧洲/马德里]”)
@配置
公共类SwaggerDocumentationConfig{
apinfo apinfo(){
返回新的ApiInfoBuilder()
.标题(“产品API”)
.description(“这是一个示例服务器产品-文章服务器”)
.许可证(“”)
.licenseUrl(“http://unlicense.org")
.termsOfServiceUrl(“”)
.版本(“1.0.0”)
.联系人(新联系人(“,”,“))
.build();
}
@豆子
公共摘要定制实现(){
返回新摘要(DocumentationType.SWAGGER_2)
.选择()
.api(RequestHandlerSelectors.basePackage(“com.mypackage.web.api”))
.build()
.directModelSubstitute(java.time.LocalDate.class、java.sql.Date.class)
.directModelSubstitute(java.time.OffsetDateTime.class、java.util.Date.class)
.apinfo(apinfo());
}
}
在我编译代码时总是大摇大摆地生成codegen的pom


4.0.0
昂首阔步
大摇大摆的弹簧
罐子
大摇大摆的弹簧
1.0.0
1.8
${java.version}
${java.version}
2.9.2
org.springframework.boot
spring启动程序父级
1.5.22.发布
src/main/java
org.springframework.boot
springbootmaven插件
重新包装
org.springframework.boot
SpringBootStarterWeb
org.springframework.boot
弹簧启动机tomcat
伊奥·斯普林福克斯
springfox-Swagger 2
${springfox版本}
伊奥·斯普林福克斯
springfox招摇过市用户界面
${springfox版本}
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
javax.validation
验证api
org.springframework.boot
弹簧起动试验
测试

你可以试试
@Conditional
我做不到,因为它是自动生成的代码,并且在目标文件夹中。当我再次编译时,它将被替换为原始版本。您在pom中有springfox依赖项吗?也许你可以用occomplete pom.xml更新你的问题,显示生成这个配置类的插件。不,我没有。但是,当我编译时,狂妄自大的codegen总是生成其他pom。我会编辑我的帖子。springfox依赖项在pom中,但我无法修改它。