forked from loafle/openapi-generator-original
withXml replaces useJaxbAnnotations (#6152)
* Regenerated bin/jaxrs-* * Replace `useJaxbAnnotations` with `withXml`
This commit is contained in:
@@ -150,7 +150,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
.SERIALIZE_BIG_DECIMAL_AS_STRING_DESC));
|
||||
cliOptions.add(CliOption.newBoolean(FULL_JAVA_UTIL, "whether to use fully qualified name for classes under java.util. This option only works for Java API client"));
|
||||
cliOptions.add(new CliOption("hideGenerationTimestamp", "hides the timestamp when files were generated"));
|
||||
cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type. This option only works for Java API client (resttemplate)"));
|
||||
cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)"));
|
||||
|
||||
CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use");
|
||||
Map<String, String> dateOptions = new HashMap<String, String>();
|
||||
|
||||
@@ -11,20 +11,17 @@ import org.slf4j.LoggerFactory;
|
||||
import io.swagger.codegen.CliOption;
|
||||
import io.swagger.codegen.CodegenModel;
|
||||
import io.swagger.codegen.CodegenOperation;
|
||||
import io.swagger.codegen.CodegenParameter;
|
||||
import io.swagger.codegen.CodegenProperty;
|
||||
import io.swagger.codegen.CodegenResponse;
|
||||
import io.swagger.codegen.CodegenType;
|
||||
import io.swagger.codegen.SupportingFile;
|
||||
import io.swagger.codegen.languages.features.BeanValidationFeatures;
|
||||
import io.swagger.codegen.languages.features.GzipTestFeatures;
|
||||
import io.swagger.codegen.languages.features.JaxbFeatures;
|
||||
import io.swagger.codegen.languages.features.LoggingTestFeatures;
|
||||
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
|
||||
import io.swagger.models.Operation;
|
||||
|
||||
public class JavaCXFClientCodegen extends AbstractJavaCodegen
|
||||
implements BeanValidationFeatures, UseGenericResponseFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures {
|
||||
implements BeanValidationFeatures, UseGenericResponseFeatures, GzipTestFeatures, LoggingTestFeatures {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class);
|
||||
|
||||
@@ -34,8 +31,6 @@ private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodege
|
||||
*/
|
||||
protected static final String JAXRS_TEMPLATE_DIRECTORY_NAME = "JavaJaxRS";
|
||||
|
||||
protected boolean useJaxbAnnotations = true;
|
||||
|
||||
protected boolean useBeanValidation = false;
|
||||
|
||||
protected boolean useGenericResponse = false;
|
||||
@@ -73,8 +68,6 @@ private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodege
|
||||
|
||||
embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf";
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(USE_JAXB_ANNOTATIONS, "Use JAXB annotations for XML"));
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests"));
|
||||
@@ -89,11 +82,6 @@ private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodege
|
||||
{
|
||||
super.processOpts();
|
||||
|
||||
if (additionalProperties.containsKey(USE_JAXB_ANNOTATIONS)) {
|
||||
boolean useJaxbAnnotationsProp = convertPropertyToBooleanAndWriteBack(USE_JAXB_ANNOTATIONS);
|
||||
this.setUseJaxbAnnotations(useJaxbAnnotationsProp);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(USE_BEANVALIDATION)) {
|
||||
boolean useBeanValidationProp = convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION);
|
||||
this.setUseBeanValidation(useBeanValidationProp);
|
||||
@@ -177,11 +165,6 @@ private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodege
|
||||
this.useBeanValidation = useBeanValidation;
|
||||
}
|
||||
|
||||
|
||||
public void setUseJaxbAnnotations(boolean useJaxbAnnotations) {
|
||||
this.useJaxbAnnotations = useJaxbAnnotations;
|
||||
}
|
||||
|
||||
public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests) {
|
||||
this.useGzipFeatureForTests = useGzipFeatureForTests;
|
||||
}
|
||||
|
||||
@@ -15,20 +15,17 @@ import io.swagger.codegen.CodegenProperty;
|
||||
import io.swagger.codegen.SupportingFile;
|
||||
import io.swagger.codegen.languages.features.CXFServerFeatures;
|
||||
import io.swagger.codegen.languages.features.GzipTestFeatures;
|
||||
import io.swagger.codegen.languages.features.JaxbFeatures;
|
||||
import io.swagger.codegen.languages.features.LoggingTestFeatures;
|
||||
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
|
||||
import io.swagger.models.Operation;
|
||||
|
||||
public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures, UseGenericResponseFeatures
|
||||
{
|
||||
implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, UseGenericResponseFeatures
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFServerCodegen.class);
|
||||
|
||||
protected boolean addConsumesProducesJson = true;
|
||||
|
||||
protected boolean useJaxbAnnotations = true;
|
||||
|
||||
protected boolean generateSpringApplication = false;
|
||||
|
||||
protected boolean useSpringAnnotationConfig = false;
|
||||
@@ -86,8 +83,6 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
|
||||
embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf";
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(USE_JAXB_ANNOTATIONS, "Use JAXB annotations for XML"));
|
||||
|
||||
cliOptions.add(CliOption.newBoolean(GENERATE_SPRING_APPLICATION, "Generate Spring application"));
|
||||
cliOptions.add(CliOption.newBoolean(USE_SPRING_ANNOTATION_CONFIG, "Use Spring Annotation Config"));
|
||||
|
||||
@@ -124,11 +119,6 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
{
|
||||
super.processOpts();
|
||||
|
||||
if (additionalProperties.containsKey(USE_JAXB_ANNOTATIONS)) {
|
||||
boolean useJaxbAnnotationsProp = convertPropertyToBooleanAndWriteBack(USE_JAXB_ANNOTATIONS);
|
||||
this.setUseJaxbAnnotations(useJaxbAnnotationsProp);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(ADD_CONSUMES_PRODUCES_JSON)) {
|
||||
this.setAddConsumesProducesJson(convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON));
|
||||
}
|
||||
@@ -288,10 +278,6 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
||||
this.generateSpringBootApplication = generateSpringBootApplication;
|
||||
}
|
||||
|
||||
public void setUseJaxbAnnotations(boolean useJaxbAnnotations) {
|
||||
this.useJaxbAnnotations = useJaxbAnnotations;
|
||||
}
|
||||
|
||||
public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor) {
|
||||
this.generateJbossDeploymentDescriptor = generateJbossDeploymentDescriptor;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package io.swagger.codegen.languages.features;
|
||||
|
||||
public interface JaxbFeatures {
|
||||
public static final String USE_JAXB_ANNOTATIONS = "useJaxbAnnotations";
|
||||
|
||||
public void setUseJaxbAnnotations(boolean useJaxbAnnotations);
|
||||
}
|
||||
Reference in New Issue
Block a user