Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@
import static io.swagger.codegen.CodegenConstants.HAS_REQUIRED_EXT_NAME;
import static io.swagger.codegen.CodegenConstants.IS_ARRAY_MODEL_EXT_NAME;
import static io.swagger.codegen.CodegenConstants.IS_ENUM_EXT_NAME;
import static io.swagger.codegen.handlebars.helpers.ExtensionHelper.getBooleanValue;
import static io.swagger.codegen.languages.CodegenHelper.getDefaultIncludes;
import static io.swagger.codegen.languages.CodegenHelper.getImportMappings;
import static io.swagger.codegen.languages.CodegenHelper.getTypeMappings;
import static io.swagger.codegen.languages.CodegenHelper.initalizeSpecialCharacterMapping;
import static io.swagger.codegen.handlebars.helpers.ExtensionHelper.getBooleanValue;
import static io.swagger.codegen.utils.ModelUtils.processCodegenModels;

public abstract class DefaultCodegenConfig implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegenConfig.class);

protected static final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegenConfig.class);
public static final String DEFAULT_CONTENT_TYPE = "application/json";
public static final String REQUEST_BODY_NAME = "body";
public static final String DEFAULT_TEMPLATE_VERSION = "v2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.languages.DefaultCodegenConfig;
import io.swagger.codegen.handlebars.helpers.JavaHelper;
import io.swagger.codegen.languages.DefaultCodegenConfig;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.PathItem;
Expand Down Expand Up @@ -40,7 +40,7 @@
import static io.swagger.codegen.handlebars.helpers.ExtensionHelper.getBooleanValue;

public abstract class AbstractJavaCodegen extends DefaultCodegenConfig {
static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class);
private static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class);
public static final String FULL_JAVA_UTIL = "fullJavaUtil";
public static final String DEFAULT_LIBRARY = "<default>";
public static final String DATE_LIBRARY = "dateLibrary";
Expand Down Expand Up @@ -75,13 +75,13 @@ public abstract class AbstractJavaCodegen extends DefaultCodegenConfig {
protected String javaUtilPrefix = "";
protected Boolean serializableModel = false;
protected boolean serializeBigDecimalAsString = false;
protected boolean hideGenerationTimestamp = false;
protected String apiDocPath = "docs/";
protected String modelDocPath = "docs/";
protected boolean supportJava6= false;

public AbstractJavaCodegen() {
super();
hideGenerationTimestamp = false;
supportsInheritance = true;

setReservedWordsLowerCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import static io.swagger.codegen.languages.helpers.ExtensionHelper.getBooleanValue;

public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures {
private static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class);

/**
* Name of the sub-directory in "src/main/resource" where to find the
* Mustache template for the JAX-RS Codegen.
Expand All @@ -34,8 +36,6 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen

protected boolean useBeanValidation = true;

static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class);

public AbstractJavaJAXRSServerCodegen() {
super();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
*/
public class JavaJAXRSCXFCDIServerCodegen extends JavaJAXRSSpecServerCodegen implements BeanValidationFeatures {

protected boolean useBeanValidation = true;

/**
* Default constructor
*/
public JavaJAXRSCXFCDIServerCodegen() {
useBeanValidation = true;
outputFolder = "generated-code/JavaJaxRS-CXF-CDI";
artifactId = "swagger-jaxrs-cxf-cdi-server";
sourceFolder = "src" + File.separator + "gen" + File.separator + "java";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
protected static final String LIBRARY_JERSEY2 = "jersey2";

/**
* Default library template to use. (Default:{@value #DEFAULT_LIBRARY})
* Default library template to use. (Default:{@value #DEFAULT_JERSEY_LIBRARY})
*/
public static final String DEFAULT_LIBRARY = LIBRARY_JERSEY2;
public static final String DEFAULT_JERSEY_LIBRARY = LIBRARY_JERSEY2;
public static final String USE_TAGS = "useTags";

protected boolean useTags = false;
Expand All @@ -40,7 +40,7 @@ public JavaJerseyServerCodegen() {
supportedLibraries.put(LIBRARY_JERSEY1, "Jersey core 1.x");
supportedLibraries.put(LIBRARY_JERSEY2, "Jersey core 2.x");
library.setEnum(supportedLibraries);
library.setDefault(DEFAULT_LIBRARY);
library.setDefault(DEFAULT_JERSEY_LIBRARY);

cliOptions.add(library);
cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1/2 library."));
Expand Down Expand Up @@ -100,7 +100,7 @@ public void processOpts() {

// use default library if unset
if (StringUtils.isEmpty(library)) {
setLibrary(DEFAULT_LIBRARY);
setLibrary(DEFAULT_JERSEY_LIBRARY);
}

if (additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

public class JavaResteasyEapServerCodegen extends AbstractJavaJAXRSServerCodegen implements JbossFeature, BeanValidationFeatures, SwaggerFeatures {

protected boolean useBeanValidation = true;
protected boolean generateJbossDeploymentDescriptor = true;
protected boolean useSwaggerFeature = false;

public JavaResteasyEapServerCodegen() {

super();

useBeanValidation = true;

artifactId = "swagger-jaxrs-resteasy-eap-server";

outputFolder = "generated-code/JavaJaxRS-Resteasy-eap";
Expand Down