forked from loafle/openapi-generator-original
Refactoring: Use lombok for simple getters & setters (#18559)
* Add missing @Override annotation * Fix JavaDoc unresolved symbol * Fix JavaDoc method link * Remove unnecessary semicolon * Remove method identical to super implementations * Replace repetitive getter code with Lombok @Getter See https://projectlombok.org/features/GetterSetter * Replace repetitive setter code with Lombok @Setter See https://projectlombok.org/features/GetterSetter * Generate no-args constructor with Lombok * Generate all-args constructor with Lombok * Fix parameter naming * Replace stubbed abstract class implementations with Mockito mocks * Remove unused import(s)
This commit is contained in:
parent
42c78403cb
commit
aef4d75fd5
@ -19,16 +19,12 @@ package org.openapitools.codegen.cmd;
|
|||||||
import ch.qos.logback.classic.Level;
|
import ch.qos.logback.classic.Level;
|
||||||
import ch.qos.logback.classic.LoggerContext;
|
import ch.qos.logback.classic.LoggerContext;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonFactory;
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
import com.fasterxml.jackson.core.JsonToken;
|
import com.fasterxml.jackson.core.JsonToken;
|
||||||
import com.fasterxml.jackson.core.TreeNode;
|
|
||||||
import com.fasterxml.jackson.databind.*;
|
import com.fasterxml.jackson.databind.*;
|
||||||
import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
|
import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
|
||||||
import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer;
|
import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
||||||
import com.fasterxml.jackson.databind.util.TokenBuffer;
|
import com.fasterxml.jackson.databind.util.TokenBuffer;
|
||||||
|
|
||||||
import io.airlift.airline.Arguments;
|
import io.airlift.airline.Arguments;
|
||||||
|
@ -28,7 +28,6 @@ import io.airlift.airline.Command;
|
|||||||
import io.airlift.airline.Option;
|
import io.airlift.airline.Option;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.openapitools.codegen.CodegenConfig;
|
import org.openapitools.codegen.CodegenConfig;
|
||||||
import org.openapitools.codegen.DefaultGenerator;
|
|
||||||
import org.openapitools.codegen.SupportingFile;
|
import org.openapitools.codegen.SupportingFile;
|
||||||
import org.openapitools.codegen.TemplateManager;
|
import org.openapitools.codegen.TemplateManager;
|
||||||
import org.openapitools.codegen.api.TemplatePathLocator;
|
import org.openapitools.codegen.api.TemplatePathLocator;
|
||||||
@ -40,7 +39,6 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Reader;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -9,7 +9,6 @@ import org.testng.annotations.Test;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
public class AuthorTemplateTest {
|
public class AuthorTemplateTest {
|
||||||
Path outputDirectory;
|
Path outputDirectory;
|
||||||
|
@ -6,7 +6,6 @@ import org.openapitools.codegen.config.Context;
|
|||||||
import org.openapitools.codegen.config.GeneratorSettings;
|
import org.openapitools.codegen.config.GeneratorSettings;
|
||||||
import org.openapitools.codegen.config.WorkflowSettings;
|
import org.openapitools.codegen.config.WorkflowSettings;
|
||||||
import org.testng.ITestContext;
|
import org.testng.ITestContext;
|
||||||
import org.testng.TestRunner;
|
|
||||||
import org.testng.annotations.BeforeTest;
|
import org.testng.annotations.BeforeTest;
|
||||||
import org.testng.annotations.DataProvider;
|
import org.testng.annotations.DataProvider;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -24,7 +24,6 @@ import org.openapitools.codegen.DefaultGenerator;
|
|||||||
import org.openapitools.codegen.Generator;
|
import org.openapitools.codegen.Generator;
|
||||||
import org.openapitools.codegen.SpecValidationException;
|
import org.openapitools.codegen.SpecValidationException;
|
||||||
import org.openapitools.codegen.config.CodegenConfigurator;
|
import org.openapitools.codegen.config.CodegenConfigurator;
|
||||||
import org.testng.TestException;
|
|
||||||
import org.testng.annotations.AfterMethod;
|
import org.testng.annotations.AfterMethod;
|
||||||
import org.testng.annotations.BeforeMethod;
|
import org.testng.annotations.BeforeMethod;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -38,5 +38,5 @@ public enum DocumentationFeature {
|
|||||||
* Generated output includes documentation for all generated APIs.
|
* Generated output includes documentation for all generated APIs.
|
||||||
*/
|
*/
|
||||||
@ToolingExtension
|
@ToolingExtension
|
||||||
Api;
|
Api
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ import com.google.common.io.ByteSource;
|
|||||||
import com.google.common.io.CharSource;
|
import com.google.common.io.CharSource;
|
||||||
import io.swagger.v3.parser.core.models.ParseOptions;
|
import io.swagger.v3.parser.core.models.ParseOptions;
|
||||||
import io.swagger.v3.parser.util.ClasspathHelper;
|
import io.swagger.v3.parser.util.ClasspathHelper;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -96,6 +97,7 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
* The build context is only avail when running from within eclipse.
|
* The build context is only avail when running from within eclipse.
|
||||||
* It is used to update the eclipse-m2e-layer when the plugin is executed inside the IDE.
|
* It is used to update the eclipse-m2e-layer when the plugin is executed inside the IDE.
|
||||||
*/
|
*/
|
||||||
|
@Setter
|
||||||
@Component
|
@Component
|
||||||
private BuildContext buildContext = new DefaultBuildContext();
|
private BuildContext buildContext = new DefaultBuildContext();
|
||||||
|
|
||||||
@ -556,10 +558,6 @@ public class CodeGenMojo extends AbstractMojo {
|
|||||||
@Parameter(readonly = true, required = true, defaultValue = "${project}")
|
@Parameter(readonly = true, required = true, defaultValue = "${project}")
|
||||||
private MavenProject project;
|
private MavenProject project;
|
||||||
|
|
||||||
public void setBuildContext(BuildContext buildContext) {
|
|
||||||
this.buildContext = buildContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws MojoExecutionException {
|
public void execute() throws MojoExecutionException {
|
||||||
if (StringUtils.isBlank(inputSpec) && StringUtils.isBlank(inputSpecRootDirectory)) {
|
if (StringUtils.isBlank(inputSpec) && StringUtils.isBlank(inputSpecRootDirectory)) {
|
||||||
|
@ -39,10 +39,8 @@ import org.apache.maven.project.ProjectBuilder;
|
|||||||
import org.apache.maven.project.ProjectBuildingRequest;
|
import org.apache.maven.project.ProjectBuildingRequest;
|
||||||
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
||||||
import org.eclipse.aether.DefaultRepositorySystemSession;
|
import org.eclipse.aether.DefaultRepositorySystemSession;
|
||||||
import org.eclipse.aether.impl.DefaultServiceLocator;
|
|
||||||
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
|
||||||
import org.eclipse.aether.repository.LocalRepository;
|
import org.eclipse.aether.repository.LocalRepository;
|
||||||
import org.eclipse.aether.RepositorySystem;
|
|
||||||
|
|
||||||
public class CodeGenMojoTest extends BaseTestCase {
|
public class CodeGenMojoTest extends BaseTestCase {
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,8 +17,12 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.online.model;
|
package org.openapitools.codegen.online.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
import javax.xml.bind.annotation.XmlTransient;
|
||||||
|
|
||||||
|
@Setter
|
||||||
@javax.xml.bind.annotation.XmlRootElement
|
@javax.xml.bind.annotation.XmlRootElement
|
||||||
public class ApiResponse {
|
public class ApiResponse {
|
||||||
public static final int ERROR = 1;
|
public static final int ERROR = 1;
|
||||||
@ -28,8 +32,8 @@ public class ApiResponse {
|
|||||||
public static final int TOO_BUSY = 5;
|
public static final int TOO_BUSY = 5;
|
||||||
|
|
||||||
int code;
|
int code;
|
||||||
String type;
|
@Getter String type;
|
||||||
String message;
|
@Getter String message;
|
||||||
|
|
||||||
public ApiResponse() {}
|
public ApiResponse() {}
|
||||||
|
|
||||||
@ -62,24 +66,4 @@ public class ApiResponse {
|
|||||||
public int getCode() {
|
public int getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(int code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,23 +17,11 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.online.model;
|
package org.openapitools.codegen.online.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
public class Generated {
|
public class Generated {
|
||||||
private String filename;
|
private String filename;
|
||||||
private String friendlyName;
|
private String friendlyName;
|
||||||
|
|
||||||
public String getFilename() {
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFilename(String filename) {
|
|
||||||
this.filename = filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFriendlyName() {
|
|
||||||
return friendlyName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFriendlyName(String friendlyName) {
|
|
||||||
this.friendlyName = friendlyName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -20,45 +20,20 @@ package org.openapitools.codegen.online.model;
|
|||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.v3.parser.core.models.AuthorizationValue;
|
import io.swagger.v3.parser.core.models.AuthorizationValue;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Setter
|
||||||
public class GeneratorInput {
|
public class GeneratorInput {
|
||||||
private JsonNode spec;
|
@Getter private JsonNode spec;
|
||||||
private Map<String, String> options;
|
@Getter private Map<String, String> options;
|
||||||
private String openAPIUrl;
|
private String openAPIUrl;
|
||||||
private AuthorizationValue authorizationValue;
|
@Getter private AuthorizationValue authorizationValue;
|
||||||
|
|
||||||
public AuthorizationValue getAuthorizationValue() {
|
|
||||||
return authorizationValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthorizationValue(AuthorizationValue authorizationValue) {
|
|
||||||
this.authorizationValue = authorizationValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JsonNode getSpec() {
|
|
||||||
return spec;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpec(JsonNode spec) {
|
|
||||||
this.spec = spec;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getOptions() {
|
|
||||||
return options;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOptions(Map<String, String> options) {
|
|
||||||
this.options = options;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiModelProperty(example = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml")
|
@ApiModelProperty(example = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml")
|
||||||
public String getOpenAPIUrl() {
|
public String getOpenAPIUrl() {
|
||||||
return openAPIUrl;
|
return openAPIUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOpenAPIUrl(String url) {
|
|
||||||
this.openAPIUrl = url;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -18,36 +18,25 @@
|
|||||||
package org.openapitools.codegen.online.model;
|
package org.openapitools.codegen.online.model;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Setter @NoArgsConstructor @AllArgsConstructor
|
||||||
public class ResponseCode {
|
public class ResponseCode {
|
||||||
private String code;
|
private String code;
|
||||||
private String link;
|
private String link;
|
||||||
|
|
||||||
public ResponseCode() {}
|
|
||||||
|
|
||||||
public ResponseCode(String code, String link) {
|
|
||||||
setCode(code);
|
|
||||||
setLink(link);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "File download code",
|
@ApiModelProperty(value = "File download code",
|
||||||
example = "d40029be-eda6-4d62-b1ef-d05e2e91a72a")
|
example = "d40029be-eda6-4d62-b1ef-d05e2e91a72a")
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(String code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiModelProperty(
|
@ApiModelProperty(
|
||||||
value = "URL for fetching the generated client",
|
value = "URL for fetching the generated client",
|
||||||
example = "http://localhost:8080/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a")
|
example = "http://localhost:8080/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a")
|
||||||
public String getLink() {
|
public String getLink() {
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLink(String link) {
|
|
||||||
this.link = link;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -19,17 +19,21 @@ package org.openapitools.codegen;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class CliOption {
|
public class CliOption {
|
||||||
private final String opt;
|
@Getter private final String opt;
|
||||||
|
@Getter @Setter
|
||||||
private String description;
|
private String description;
|
||||||
|
@Getter @Setter
|
||||||
private String type;
|
private String type;
|
||||||
private String defaultValue;
|
private String defaultValue;
|
||||||
private String optValue;
|
@Getter private String optValue;
|
||||||
private Map<String, String> enumValues;
|
private Map<String, String> enumValues;
|
||||||
|
|
||||||
public CliOption(String opt, String description) {
|
public CliOption(String opt, String description) {
|
||||||
@ -42,26 +46,6 @@ public class CliOption {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOpt() {
|
|
||||||
return opt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefault() {
|
public String getDefault() {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
@ -75,10 +59,6 @@ public class CliOption {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOptValue() {
|
|
||||||
return this.optValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOptValue(String optValue) {
|
public void setOptValue(String optValue) {
|
||||||
if (this.enumValues!=null && this.enumValues.containsKey(optValue)) {
|
if (this.enumValues!=null && this.enumValues.containsKey(optValue)) {
|
||||||
this.optValue = optValue;
|
this.optValue = optValue;
|
||||||
|
@ -20,6 +20,7 @@ package org.openapitools.codegen;
|
|||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.parser.core.models.AuthorizationValue;
|
import io.swagger.v3.parser.core.models.AuthorizationValue;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import org.openapitools.codegen.api.TemplateDefinition;
|
import org.openapitools.codegen.api.TemplateDefinition;
|
||||||
import org.openapitools.codegen.auth.AuthParser;
|
import org.openapitools.codegen.auth.AuthParser;
|
||||||
import org.openapitools.codegen.config.GeneratorSettings;
|
import org.openapitools.codegen.config.GeneratorSettings;
|
||||||
@ -31,7 +32,8 @@ public class ClientOptInput {
|
|||||||
private GeneratorSettings generatorSettings;
|
private GeneratorSettings generatorSettings;
|
||||||
private OpenAPI openAPI;
|
private OpenAPI openAPI;
|
||||||
private List<AuthorizationValue> auths;
|
private List<AuthorizationValue> auths;
|
||||||
private List<TemplateDefinition> userDefinedTemplates;
|
// not deprecated as this is added to match other functionality, we need to move to Context<?> instead of ClientOptInput.
|
||||||
|
@Getter private List<TemplateDefinition> userDefinedTemplates;
|
||||||
|
|
||||||
public ClientOptInput openAPI(OpenAPI openAPI) {
|
public ClientOptInput openAPI(OpenAPI openAPI) {
|
||||||
this.setOpenAPI(openAPI);
|
this.setOpenAPI(openAPI);
|
||||||
@ -79,11 +81,6 @@ public class ClientOptInput {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TemplateDefinition> getUserDefinedTemplates() {
|
|
||||||
// not deprecated as this is added to match other functionality, we need to move to Context<?> instead of ClientOptInput.
|
|
||||||
return userDefinedTemplates;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the generator/config instance
|
* Sets the generator/config instance
|
||||||
*
|
*
|
||||||
|
@ -16,8 +16,12 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
public class CodegenComposedSchemas {
|
public class CodegenComposedSchemas {
|
||||||
private List<CodegenProperty> allOf;
|
private List<CodegenProperty> allOf;
|
||||||
private List<CodegenProperty> oneOf;
|
private List<CodegenProperty> oneOf;
|
||||||
@ -31,38 +35,6 @@ public class CodegenComposedSchemas {
|
|||||||
this.not = not;
|
this.not = not;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CodegenProperty> getAllOf() {
|
|
||||||
return allOf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenProperty> getOneOf() {
|
|
||||||
return oneOf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenProperty> getAnyOf() {
|
|
||||||
return anyOf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CodegenProperty getNot() {
|
|
||||||
return not;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllOf(List<CodegenProperty> allOf) {
|
|
||||||
this.allOf = allOf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOneOf(List<CodegenProperty> oneOf) {
|
|
||||||
this.oneOf = oneOf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnyOf(List<CodegenProperty> anyOf) {
|
|
||||||
this.anyOf = anyOf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNot(CodegenProperty not) {
|
|
||||||
this.not = not;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
final StringBuilder sb = new StringBuilder("CodegenComposedSchemas{");
|
final StringBuilder sb = new StringBuilder("CodegenComposedSchemas{");
|
||||||
sb.append("oneOf=").append(oneOf);
|
sb.append("oneOf=").append(oneOf);
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,10 +17,15 @@ import java.util.*;
|
|||||||
public class CodegenDiscriminator {
|
public class CodegenDiscriminator {
|
||||||
// The name of the property in the payload that will hold the discriminator value.
|
// The name of the property in the payload that will hold the discriminator value.
|
||||||
// This is the propertyName as specified in the OpenAPI discriminator object.
|
// This is the propertyName as specified in the OpenAPI discriminator object.
|
||||||
|
@Getter @Setter
|
||||||
private String propertyName;
|
private String propertyName;
|
||||||
|
@Getter @Setter
|
||||||
private String propertyBaseName;
|
private String propertyBaseName;
|
||||||
|
@Getter @Setter
|
||||||
private String propertyGetter;
|
private String propertyGetter;
|
||||||
|
@Getter @Setter
|
||||||
private String propertyType;
|
private String propertyType;
|
||||||
|
@Getter @Setter
|
||||||
private Map<String, String> mapping;
|
private Map<String, String> mapping;
|
||||||
private boolean isEnum;
|
private boolean isEnum;
|
||||||
|
|
||||||
@ -36,58 +44,12 @@ public class CodegenDiscriminator {
|
|||||||
//
|
//
|
||||||
// see the method createDiscriminator in DefaultCodegen.java
|
// see the method createDiscriminator in DefaultCodegen.java
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
private Set<MappedModel> mappedModels = new TreeSet<>();
|
private Set<MappedModel> mappedModels = new TreeSet<>();
|
||||||
|
@Getter @Setter
|
||||||
private Map<String, Object> vendorExtensions = new HashMap<>();
|
private Map<String, Object> vendorExtensions = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
public String getPropertyName() {
|
|
||||||
return propertyName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPropertyName(String propertyName) {
|
|
||||||
this.propertyName = propertyName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPropertyGetter() {
|
|
||||||
return propertyGetter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPropertyGetter(String propertyGetter) {
|
|
||||||
this.propertyGetter = propertyGetter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPropertyBaseName() {
|
|
||||||
return propertyBaseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPropertyBaseName(String propertyBaseName) {
|
|
||||||
this.propertyBaseName = propertyBaseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPropertyType() {
|
|
||||||
return propertyType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPropertyType(String propertyType) {
|
|
||||||
this.propertyType = propertyType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getMapping() {
|
|
||||||
return mapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMapping(Map<String, String> mapping) {
|
|
||||||
this.mapping = mapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<MappedModel> getMappedModels() {
|
|
||||||
return mappedModels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMappedModels(Set<MappedModel> mappedModels) {
|
|
||||||
this.mappedModels = mappedModels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getIsEnum() {
|
public boolean getIsEnum() {
|
||||||
return isEnum;
|
return isEnum;
|
||||||
}
|
}
|
||||||
@ -95,15 +57,7 @@ public class CodegenDiscriminator {
|
|||||||
public void setIsEnum(boolean isEnum) {
|
public void setIsEnum(boolean isEnum) {
|
||||||
this.isEnum = isEnum;
|
this.isEnum = isEnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getVendorExtensions() {
|
|
||||||
return vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVendorExtensions(Map<String, Object> vendorExtensions) {
|
|
||||||
this.vendorExtensions = vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An object to hold discriminator mappings between payload values and schema names or
|
* An object to hold discriminator mappings between payload values and schema names or
|
||||||
* references.
|
* references.
|
||||||
@ -116,11 +70,14 @@ public class CodegenDiscriminator {
|
|||||||
*/
|
*/
|
||||||
public static class MappedModel implements Comparable<MappedModel>{
|
public static class MappedModel implements Comparable<MappedModel>{
|
||||||
// The value of the discriminator property in the payload.
|
// The value of the discriminator property in the payload.
|
||||||
|
@Getter @Setter
|
||||||
private String mappingName;
|
private String mappingName;
|
||||||
// The OAS schema name. It is obtained from the OAS document, and the string value
|
// The OAS schema name. It is obtained from the OAS document, and the string value
|
||||||
// is converted to a sanitized, internal representation within codegen.
|
// is converted to a sanitized, internal representation within codegen.
|
||||||
|
@Getter @Setter
|
||||||
private String modelName;
|
private String modelName;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
private CodegenModel model;
|
private CodegenModel model;
|
||||||
|
|
||||||
private final boolean explicitMapping;
|
private final boolean explicitMapping;
|
||||||
@ -154,26 +111,6 @@ public class CodegenDiscriminator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMappingName() {
|
|
||||||
return mappingName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMappingName(String mappingName) {
|
|
||||||
this.mappingName = mappingName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getModelName() {
|
|
||||||
return modelName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModelName(String modelName) {
|
|
||||||
this.modelName = modelName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CodegenModel getModel() { return model; }
|
|
||||||
|
|
||||||
public void setModel(CodegenModel model) { this.model = model; }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class CodegenEncoding {
|
public class CodegenEncoding {
|
||||||
private String contentType;
|
@Getter private String contentType;
|
||||||
private List<CodegenParameter> headers;
|
@Getter private List<CodegenParameter> headers;
|
||||||
private String style;
|
@Getter private String style;
|
||||||
private boolean explode;
|
private boolean explode;
|
||||||
private boolean allowReserved;
|
private boolean allowReserved;
|
||||||
public Map<String, Object> vendorExtensions = new HashMap<>();
|
@Getter public Map<String, Object> vendorExtensions = new HashMap<>();
|
||||||
|
|
||||||
public CodegenEncoding(String contentType, List<CodegenParameter> headers, String style, boolean explode, boolean allowReserved) {
|
public CodegenEncoding(String contentType, List<CodegenParameter> headers, String style, boolean explode, boolean allowReserved) {
|
||||||
this.contentType = contentType;
|
this.contentType = contentType;
|
||||||
@ -21,18 +23,6 @@ public class CodegenEncoding {
|
|||||||
this.allowReserved = allowReserved;
|
this.allowReserved = allowReserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
|
||||||
return contentType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenParameter> getHeaders() {
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStyle() {
|
|
||||||
return style;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getExplode() {
|
public boolean getExplode() {
|
||||||
return explode;
|
return explode;
|
||||||
}
|
}
|
||||||
@ -41,10 +31,6 @@ public class CodegenEncoding {
|
|||||||
return allowReserved;
|
return allowReserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getVendorExtensions() {
|
|
||||||
return vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
final StringBuilder sb = new StringBuilder("CodegenEncoding{");
|
final StringBuilder sb = new StringBuilder("CodegenEncoding{");
|
||||||
sb.append("contentType=").append(contentType);
|
sb.append("contentType=").append(contentType);
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.examples.Example;
|
import io.swagger.v3.oas.models.examples.Example;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class CodegenMediaType {
|
@Getter public class CodegenMediaType {
|
||||||
private CodegenProperty schema;
|
private CodegenProperty schema;
|
||||||
private LinkedHashMap<String, CodegenEncoding> encoding;
|
private LinkedHashMap<String, CodegenEncoding> encoding;
|
||||||
private HashMap<String, SchemaTestCase> testCases = new HashMap<>();
|
private HashMap<String, SchemaTestCase> testCases = new HashMap<>();
|
||||||
@ -33,28 +34,6 @@ public class CodegenMediaType {
|
|||||||
this.example = example;
|
this.example = example;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodegenProperty getSchema() {
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkedHashMap<String, CodegenEncoding> getEncoding() {
|
|
||||||
return encoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashMap<String, SchemaTestCase> getTestCases() { return testCases; }
|
|
||||||
|
|
||||||
public Map<String, Example> getExamples() {
|
|
||||||
return examples;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getExample() {
|
|
||||||
return example;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> getVendorExtensions() {
|
|
||||||
return vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
final StringBuilder sb = new StringBuilder("CodegenMediaType{");
|
final StringBuilder sb = new StringBuilder("CodegenMediaType{");
|
||||||
sb.append("schema=").append(schema);
|
sb.append("schema=").append(schema);
|
||||||
|
@ -22,6 +22,8 @@ import io.swagger.v3.oas.models.ExternalDocumentation;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,15 +37,21 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
// object is a discriminator, that object is set as the parent. If no discriminator is specified,
|
// object is a discriminator, that object is set as the parent. If no discriminator is specified,
|
||||||
// codegen returns the first one in the list, i.e. there is no obvious parent in the OpenAPI specification.
|
// codegen returns the first one in the list, i.e. there is no obvious parent in the OpenAPI specification.
|
||||||
// When possible, the mustache templates should use 'allParents' to handle multiple parents.
|
// When possible, the mustache templates should use 'allParents' to handle multiple parents.
|
||||||
|
@Getter @Setter
|
||||||
public String parent, parentSchema;
|
public String parent, parentSchema;
|
||||||
|
@Getter @Setter
|
||||||
public List<String> interfaces;
|
public List<String> interfaces;
|
||||||
// The list of parent model name from the schemas. In order of preference, the parent is obtained
|
// The list of parent model name from the schemas. In order of preference, the parent is obtained
|
||||||
// from the 'allOf' attribute, then 'anyOf', and finally 'oneOf'.
|
// from the 'allOf' attribute, then 'anyOf', and finally 'oneOf'.
|
||||||
|
@Getter @Setter
|
||||||
public List<String> allParents;
|
public List<String> allParents;
|
||||||
|
|
||||||
// References to parent and interface CodegenModels. Only set when code generator supports inheritance.
|
// References to parent and interface CodegenModels. Only set when code generator supports inheritance.
|
||||||
|
@Getter @Setter
|
||||||
public CodegenModel parentModel;
|
public CodegenModel parentModel;
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenModel> interfaceModels;
|
public List<CodegenModel> interfaceModels;
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenModel> children;
|
public List<CodegenModel> children;
|
||||||
|
|
||||||
// anyOf, oneOf, allOf
|
// anyOf, oneOf, allOf
|
||||||
@ -53,42 +61,101 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
// The schema name as written in the OpenAPI document
|
// The schema name as written in the OpenAPI document
|
||||||
// If it's a reserved word, it will be escaped.
|
// If it's a reserved word, it will be escaped.
|
||||||
|
@Getter @Setter
|
||||||
public String name;
|
public String name;
|
||||||
// The original schema name as written in the OpenAPI document.
|
// The original schema name as written in the OpenAPI document.
|
||||||
|
@Getter @Setter
|
||||||
public String schemaName;
|
public String schemaName;
|
||||||
// The language-specific name of the class that implements this schema.
|
// The language-specific name of the class that implements this schema.
|
||||||
// The name of the class is derived from the OpenAPI schema name with formatting rules applied.
|
// The name of the class is derived from the OpenAPI schema name with formatting rules applied.
|
||||||
// The classname is derived from the OpenAPI schema name, with sanitization and escaping rules applied.
|
// The classname is derived from the OpenAPI schema name, with sanitization and escaping rules applied.
|
||||||
|
@Getter @Setter
|
||||||
public String classname;
|
public String classname;
|
||||||
// The value of the 'title' attribute in the OpenAPI document.
|
// The value of the 'title' attribute in the OpenAPI document.
|
||||||
|
@Getter @Setter
|
||||||
public String title;
|
public String title;
|
||||||
|
@Getter @Setter
|
||||||
public String description, classVarName, modelJson, dataType, xmlPrefix, xmlNamespace, xmlName;
|
public String description, classVarName, modelJson, dataType, xmlPrefix, xmlNamespace, xmlName;
|
||||||
|
@Getter @Setter
|
||||||
public String classFilename; // store the class file name, mainly used for import
|
public String classFilename; // store the class file name, mainly used for import
|
||||||
|
@Getter @Setter
|
||||||
public String unescapedDescription;
|
public String unescapedDescription;
|
||||||
public CodegenDiscriminator discriminator;
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Returns the discriminator for this schema object, or null if no discriminator has been specified.
|
||||||
|
* The list of all possible schema discriminator mapping values is obtained
|
||||||
|
* from explicit discriminator mapping values in the OpenAPI document, and from
|
||||||
|
* inherited discriminators through oneOf, allOf, anyOf.
|
||||||
|
* For example, a discriminator may be defined in a 'Pet' schema as shown below.
|
||||||
|
* The Dog and Cat schemas inherit the discriminator through the allOf reference.
|
||||||
|
* In the 'Pet' schema, the supported discriminator mapping values for the
|
||||||
|
* 'objectType' properties are 'Dog' and 'Cat'.
|
||||||
|
* The allowed discriminator mapping value for the Dog schema is 'Dog'.
|
||||||
|
* The allowed discriminator mapping value for the Cat schema is 'Dog'.
|
||||||
|
* Pet:
|
||||||
|
* type: object
|
||||||
|
* discriminator:
|
||||||
|
* propertyName: objectType
|
||||||
|
* required:
|
||||||
|
* - objectType
|
||||||
|
* properties:
|
||||||
|
* objectType:
|
||||||
|
* type: string
|
||||||
|
* Dog:
|
||||||
|
* allOf:
|
||||||
|
* - $ref: '#/components/schemas/Pet'
|
||||||
|
* - type: object
|
||||||
|
* properties:
|
||||||
|
* p1:
|
||||||
|
* type: string
|
||||||
|
* Cat:
|
||||||
|
* allOf:
|
||||||
|
* - $ref: '#/components/schemas/Pet'
|
||||||
|
* - type: object
|
||||||
|
* properties:
|
||||||
|
* p2:
|
||||||
|
* type: string
|
||||||
|
*
|
||||||
|
* @return the discriminator.
|
||||||
|
*/
|
||||||
|
@Getter public CodegenDiscriminator discriminator;
|
||||||
|
@Getter @Setter
|
||||||
public String defaultValue;
|
public String defaultValue;
|
||||||
|
@Getter @Setter
|
||||||
public String arrayModelType;
|
public String arrayModelType;
|
||||||
public boolean isAlias; // Is this effectively an alias of another simple type
|
public boolean isAlias; // Is this effectively an alias of another simple type
|
||||||
public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime,
|
public boolean isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, isDate, isDateTime,
|
||||||
isDecimal, isShort, isUnboundedInteger, isPrimitiveType, isBoolean, isFreeFormObject;
|
isDecimal, isShort, isUnboundedInteger, isPrimitiveType, isBoolean, isFreeFormObject;
|
||||||
private boolean additionalPropertiesIsAnyType;
|
private boolean additionalPropertiesIsAnyType;
|
||||||
public List<CodegenProperty> vars = new ArrayList<>(); // all properties (without parent's properties)
|
public List<CodegenProperty> vars = new ArrayList<>(); // all properties (without parent's properties)
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenProperty> allVars = new ArrayList<>(); // all properties (with parent's properties)
|
public List<CodegenProperty> allVars = new ArrayList<>(); // all properties (with parent's properties)
|
||||||
public List<CodegenProperty> requiredVars = new ArrayList<>(); // a list of required properties
|
public List<CodegenProperty> requiredVars = new ArrayList<>(); // a list of required properties
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenProperty> optionalVars = new ArrayList<>(); // a list of optional properties
|
public List<CodegenProperty> optionalVars = new ArrayList<>(); // a list of optional properties
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenProperty> readOnlyVars = new ArrayList<>(); // a list of read-only properties
|
public List<CodegenProperty> readOnlyVars = new ArrayList<>(); // a list of read-only properties
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenProperty> readWriteVars = new ArrayList<>(); // a list of properties for read, write
|
public List<CodegenProperty> readWriteVars = new ArrayList<>(); // a list of properties for read, write
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenProperty> parentVars = new ArrayList<>();
|
public List<CodegenProperty> parentVars = new ArrayList<>();
|
||||||
public List<CodegenProperty> parentRequiredVars = new ArrayList<>();
|
public List<CodegenProperty> parentRequiredVars = new ArrayList<>();
|
||||||
|
@Getter @Setter
|
||||||
public List<CodegenProperty> nonNullableVars = new ArrayList<>(); // a list of non-nullable properties
|
public List<CodegenProperty> nonNullableVars = new ArrayList<>(); // a list of non-nullable properties
|
||||||
|
@Getter @Setter
|
||||||
public Map<String, Object> allowableValues;
|
public Map<String, Object> allowableValues;
|
||||||
|
|
||||||
// Sorted sets of required parameters.
|
// Sorted sets of required parameters.
|
||||||
|
@Getter @Setter
|
||||||
public Set<String> mandatory = new TreeSet<>(); // without parent's required properties
|
public Set<String> mandatory = new TreeSet<>(); // without parent's required properties
|
||||||
|
@Getter @Setter
|
||||||
public Set<String> allMandatory = new TreeSet<>(); // with parent's required properties
|
public Set<String> allMandatory = new TreeSet<>(); // with parent's required properties
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
public Set<String> imports = new TreeSet<>();
|
public Set<String> imports = new TreeSet<>();
|
||||||
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation;
|
@Getter @Setter
|
||||||
|
public boolean emptyVars;
|
||||||
|
public boolean hasVars, hasMoreModels, hasEnums, isEnum, hasValidation;
|
||||||
/**
|
/**
|
||||||
* Indicates the OAS schema specifies "nullable: true".
|
* Indicates the OAS schema specifies "nullable: true".
|
||||||
*/
|
*/
|
||||||
@ -120,8 +187,10 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
* Indicates the all properties of the type are read-only.
|
* Indicates the all properties of the type are read-only.
|
||||||
*/
|
*/
|
||||||
public boolean hasOnlyReadOnly = true;
|
public boolean hasOnlyReadOnly = true;
|
||||||
|
@Getter @Setter
|
||||||
public ExternalDocumentation externalDocumentation;
|
public ExternalDocumentation externalDocumentation;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
public Map<String, Object> vendorExtensions = new HashMap<>();
|
public Map<String, Object> vendorExtensions = new HashMap<>();
|
||||||
private CodegenComposedSchemas composedSchemas;
|
private CodegenComposedSchemas composedSchemas;
|
||||||
private boolean hasMultipleTypes = false;
|
private boolean hasMultipleTypes = false;
|
||||||
@ -158,6 +227,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
* type: integer
|
* type: integer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Getter @Setter
|
||||||
public String additionalPropertiesType;
|
public String additionalPropertiesType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -193,14 +263,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
private Map<String, CodegenProperty> requiredVarsMap;
|
private Map<String, CodegenProperty> requiredVarsMap;
|
||||||
private String ref;
|
private String ref;
|
||||||
|
|
||||||
public String getAdditionalPropertiesType() {
|
|
||||||
return additionalPropertiesType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAdditionalPropertiesType(String additionalPropertiesType) {
|
|
||||||
this.additionalPropertiesType = additionalPropertiesType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodegenProperty getContains() {
|
public CodegenProperty getContains() {
|
||||||
return contains;
|
return contains;
|
||||||
@ -271,78 +333,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
|
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getAllMandatory() {
|
|
||||||
return allMandatory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllMandatory(Set<String> allMandatory) {
|
|
||||||
this.allMandatory = allMandatory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getAllParents() {
|
|
||||||
return allParents;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllParents(List<String> allParents) {
|
|
||||||
this.allParents = allParents;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenProperty> getAllVars() {
|
|
||||||
return allVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllVars(List<CodegenProperty> allVars) {
|
|
||||||
this.allVars = allVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenProperty> getNonNullableVars() {
|
|
||||||
return nonNullableVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNonNullableVars(List<CodegenProperty> nonNullableVars) {
|
|
||||||
this.nonNullableVars = nonNullableVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> getAllowableValues() {
|
|
||||||
return allowableValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowableValues(Map<String, Object> allowableValues) {
|
|
||||||
this.allowableValues = allowableValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getArrayModelType() {
|
|
||||||
return arrayModelType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArrayModelType(String arrayModelType) {
|
|
||||||
this.arrayModelType = arrayModelType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenModel> getChildren() {
|
|
||||||
return children;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setChildren(List<CodegenModel> children) {
|
|
||||||
this.children = children;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassFilename() {
|
|
||||||
return classFilename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassFilename(String classFilename) {
|
|
||||||
this.classFilename = classFilename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassVarName() {
|
|
||||||
return classVarName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassVarName(String classVarName) {
|
|
||||||
this.classVarName = classVarName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the classname property is sanitized, false if it is the same as the OpenAPI schema name.
|
* Return true if the classname property is sanitized, false if it is the same as the OpenAPI schema name.
|
||||||
* The OpenAPI schema name may be any valid JSON schema name, including non-ASCII characters.
|
* The OpenAPI schema name may be any valid JSON schema name, including non-ASCII characters.
|
||||||
@ -354,81 +344,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
return !StringUtils.equals(classname, name);
|
return !StringUtils.equals(classname, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClassname() {
|
|
||||||
return classname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassname(String classname) {
|
|
||||||
this.classname = classname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataType() {
|
|
||||||
return dataType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataType(String dataType) {
|
|
||||||
this.dataType = dataType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultValue() {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefaultValue(String defaultValue) {
|
|
||||||
this.defaultValue = defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the discriminator for this schema object, or null if no discriminator has been specified.
|
|
||||||
*
|
|
||||||
* The list of all possible schema discriminator mapping values is obtained
|
|
||||||
* from explicit discriminator mapping values in the OpenAPI document, and from
|
|
||||||
* inherited discriminators through oneOf, allOf, anyOf.
|
|
||||||
* For example, a discriminator may be defined in a 'Pet' schema as shown below.
|
|
||||||
* The Dog and Cat schemas inherit the discriminator through the allOf reference.
|
|
||||||
* In the 'Pet' schema, the supported discriminator mapping values for the
|
|
||||||
* 'objectType' properties are 'Dog' and 'Cat'.
|
|
||||||
* The allowed discriminator mapping value for the Dog schema is 'Dog'.
|
|
||||||
* The allowed discriminator mapping value for the Cat schema is 'Dog'.
|
|
||||||
*
|
|
||||||
* Pet:
|
|
||||||
* type: object
|
|
||||||
* discriminator:
|
|
||||||
* propertyName: objectType
|
|
||||||
* required:
|
|
||||||
* - objectType
|
|
||||||
* properties:
|
|
||||||
* objectType:
|
|
||||||
* type: string
|
|
||||||
* Dog:
|
|
||||||
* allOf:
|
|
||||||
* - $ref: '#/components/schemas/Pet'
|
|
||||||
* - type: object
|
|
||||||
* properties:
|
|
||||||
* p1:
|
|
||||||
* type: string
|
|
||||||
* Cat:
|
|
||||||
* allOf:
|
|
||||||
* - $ref: '#/components/schemas/Pet'
|
|
||||||
* - type: object
|
|
||||||
* properties:
|
|
||||||
* p2:
|
|
||||||
* type: string
|
|
||||||
*
|
|
||||||
* @return the discriminator.
|
|
||||||
*/
|
|
||||||
public CodegenDiscriminator getDiscriminator() {
|
|
||||||
return discriminator;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDiscriminator(CodegenDiscriminator discriminator) {
|
public void setDiscriminator(CodegenDiscriminator discriminator) {
|
||||||
this.discriminator = discriminator;
|
this.discriminator = discriminator;
|
||||||
if (discriminator != null && !discriminator.getMappedModels().isEmpty()) {
|
if (discriminator != null && !discriminator.getMappedModels().isEmpty()) {
|
||||||
@ -448,110 +363,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
return discriminator == null ? null : discriminator.getPropertyName();
|
return discriminator == null ? null : discriminator.getPropertyName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExternalDocumentation getExternalDocumentation() {
|
|
||||||
return externalDocumentation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExternalDocumentation(ExternalDocumentation externalDocumentation) {
|
|
||||||
this.externalDocumentation = externalDocumentation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getImports() {
|
|
||||||
return imports;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImports(Set<String> imports) {
|
|
||||||
this.imports = imports;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenModel> getInterfaceModels() {
|
|
||||||
return interfaceModels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterfaceModels(List<CodegenModel> interfaceModels) {
|
|
||||||
this.interfaceModels = interfaceModels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getInterfaces() {
|
|
||||||
return interfaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterfaces(List<String> interfaces) {
|
|
||||||
this.interfaces = interfaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getMandatory() {
|
|
||||||
return mandatory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMandatory(Set<String> mandatory) {
|
|
||||||
this.mandatory = mandatory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getModelJson() {
|
|
||||||
return modelJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModelJson(String modelJson) {
|
|
||||||
this.modelJson = modelJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSchemaName() {
|
|
||||||
return schemaName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSchemaName(String schemaName) {
|
|
||||||
this.schemaName = schemaName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<CodegenProperty> getOptionalVars() {
|
|
||||||
return optionalVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOptionalVars(List<CodegenProperty> optionalVars) {
|
|
||||||
this.optionalVars = optionalVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParent() {
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParent(String parent) {
|
|
||||||
this.parent = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CodegenModel getParentModel() {
|
|
||||||
return parentModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentModel(CodegenModel parentModel) {
|
|
||||||
this.parentModel = parentModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParentSchema() {
|
|
||||||
return parentSchema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentSchema(String parentSchema) {
|
|
||||||
this.parentSchema = parentSchema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenProperty> getParentVars() {
|
|
||||||
return parentVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentVars(List<CodegenProperty> parentVars) {
|
|
||||||
this.parentVars = parentVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPattern() {
|
public String getPattern() {
|
||||||
@ -823,22 +634,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
this.hasValidation = hasValidation;
|
this.hasValidation = hasValidation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CodegenProperty> getReadOnlyVars() {
|
|
||||||
return readOnlyVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReadOnlyVars(List<CodegenProperty> readOnlyVars) {
|
|
||||||
this.readOnlyVars = readOnlyVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenProperty> getReadWriteVars() {
|
|
||||||
return readWriteVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReadWriteVars(List<CodegenProperty> readWriteVars) {
|
|
||||||
this.readWriteVars = readWriteVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CodegenProperty> getRequiredVars() {
|
public List<CodegenProperty> getRequiredVars() {
|
||||||
return requiredVars;
|
return requiredVars;
|
||||||
@ -849,22 +644,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
this.requiredVars = requiredVars;
|
this.requiredVars = requiredVars;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTitle(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnescapedDescription() {
|
|
||||||
return unescapedDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUnescapedDescription(String unescapedDescription) {
|
|
||||||
this.unescapedDescription = unescapedDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CodegenProperty> getVars() {
|
public List<CodegenProperty> getVars() {
|
||||||
return vars;
|
return vars;
|
||||||
@ -875,38 +654,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
this.vars = vars;
|
this.vars = vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getVendorExtensions() {
|
|
||||||
return vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVendorExtensions(Map<String, Object> vendorExtensions) {
|
|
||||||
this.vendorExtensions = vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getXmlName() {
|
|
||||||
return xmlName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setXmlName(String xmlName) {
|
|
||||||
this.xmlName = xmlName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getXmlNamespace() {
|
|
||||||
return xmlNamespace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setXmlNamespace(String xmlNamespace) {
|
|
||||||
this.xmlNamespace = xmlNamespace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getXmlPrefix() {
|
|
||||||
return xmlPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setXmlPrefix(String xmlPrefix) {
|
|
||||||
this.xmlPrefix = xmlPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getIsNull() {
|
public boolean getIsNull() {
|
||||||
return isNull;
|
return isNull;
|
||||||
@ -1007,8 +754,10 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
this.isFreeFormObject = isFreeFormObject;
|
this.isFreeFormObject = isFreeFormObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getIsUuid() { return isUuid; }
|
public boolean getIsUuid() { return isUuid; }
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setIsUuid(boolean isUuid) { this.isUuid = isUuid; }
|
public void setIsUuid(boolean isUuid) { this.isUuid = isUuid; }
|
||||||
|
|
||||||
public boolean getIsUri() { return isUri; }
|
public boolean getIsUri() { return isUri; }
|
||||||
@ -1382,14 +1131,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmptyVars() {
|
|
||||||
return emptyVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEmptyVars(boolean emptyVars) {
|
|
||||||
this.emptyVars = emptyVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getHasItems() {
|
public boolean getHasItems() {
|
||||||
return this.items != null;
|
return this.items != null;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
public enum CodegenModelType {
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter public enum CodegenModelType {
|
||||||
|
|
||||||
MODEL(CodegenModel.class),
|
MODEL(CodegenModel.class),
|
||||||
OPERATION(CodegenOperation.class),
|
OPERATION(CodegenOperation.class),
|
||||||
@ -32,7 +34,4 @@ public enum CodegenModelType {
|
|||||||
this.defaultImplementation = defaultImplementation;
|
this.defaultImplementation = defaultImplementation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class<?> getDefaultImplementation() {
|
|
||||||
return defaultImplementation;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ import java.util.Map;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.examples.Example;
|
import io.swagger.v3.oas.models.examples.Example;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a single operation parameter in the OAS specification.
|
* Describes a single operation parameter in the OAS specification.
|
||||||
@ -67,6 +69,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
public String containerType;
|
public String containerType;
|
||||||
public String containerTypeMapped; // language-specified container type (e.g. `dict` in python for map)
|
public String containerTypeMapped; // language-specified container type (e.g. `dict` in python for map)
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
private CodegenProperty schema;
|
private CodegenProperty schema;
|
||||||
private boolean additionalPropertiesIsAnyType;
|
private boolean additionalPropertiesIsAnyType;
|
||||||
private boolean hasVars;
|
private boolean hasVars;
|
||||||
@ -130,6 +133,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
private boolean hasDiscriminatorWithNonEmptyMapping;
|
private boolean hasDiscriminatorWithNonEmptyMapping;
|
||||||
private CodegenComposedSchemas composedSchemas;
|
private CodegenComposedSchemas composedSchemas;
|
||||||
private boolean hasMultipleTypes = false;
|
private boolean hasMultipleTypes = false;
|
||||||
|
@Getter @Setter
|
||||||
private LinkedHashMap<String, CodegenMediaType> content;
|
private LinkedHashMap<String, CodegenMediaType> content;
|
||||||
private Map<String, CodegenProperty> requiredVarsMap;
|
private Map<String, CodegenProperty> requiredVarsMap;
|
||||||
private String ref;
|
private String ref;
|
||||||
@ -923,8 +927,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
return hasDiscriminatorWithNonEmptyMapping;
|
return hasDiscriminatorWithNonEmptyMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) {
|
public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) {
|
||||||
this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping;
|
this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping;
|
||||||
@ -990,22 +992,6 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
this.hasMultipleTypes = hasMultipleTypes;
|
this.hasMultipleTypes = hasMultipleTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodegenProperty getSchema() {
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSchema(CodegenProperty schema) {
|
|
||||||
this.schema = schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinkedHashMap<String, CodegenMediaType> getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContent(LinkedHashMap<String, CodegenMediaType> content) {
|
|
||||||
this.content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBaseType() {
|
public String getBaseType() {
|
||||||
return baseType;
|
return baseType;
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@ -29,42 +32,58 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
* The value of the 'type' attribute in the OpenAPI schema.
|
* The value of the 'type' attribute in the OpenAPI schema.
|
||||||
* The per-language codegen logic may change to a language-specific type.
|
* The per-language codegen logic may change to a language-specific type.
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
public String openApiType;
|
public String openApiType;
|
||||||
|
@Getter @Setter
|
||||||
public String baseName;
|
public String baseName;
|
||||||
public String complexType;
|
@Setter public String complexType;
|
||||||
|
@Getter @Setter
|
||||||
public String getter;
|
public String getter;
|
||||||
|
@Getter @Setter
|
||||||
public String setter;
|
public String setter;
|
||||||
/**
|
/**
|
||||||
* The value of the 'description' attribute in the OpenAPI schema.
|
* The value of the 'description' attribute in the OpenAPI schema.
|
||||||
*/
|
*/
|
||||||
|
@Getter @Setter
|
||||||
public String description;
|
public String description;
|
||||||
/**
|
/**
|
||||||
* The language-specific data type for this property. For example, the OpenAPI type 'integer'
|
* The language-specific data type for this property. For example, the OpenAPI type 'integer'
|
||||||
* may be represented as 'int', 'int32', 'Integer', etc, depending on the programming language.
|
* may be represented as 'int', 'int32', 'Integer', etc, depending on the programming language.
|
||||||
*/
|
*/
|
||||||
public String dataType;
|
public String dataType;
|
||||||
|
@Getter @Setter
|
||||||
public String datatypeWithEnum;
|
public String datatypeWithEnum;
|
||||||
|
@Getter @Setter
|
||||||
public String dataFormat;
|
public String dataFormat;
|
||||||
/**
|
/**
|
||||||
* The name of this property in the OpenAPI schema.
|
* The name of this property in the OpenAPI schema.
|
||||||
*/
|
*/
|
||||||
|
@Getter @Setter
|
||||||
public String name;
|
public String name;
|
||||||
|
@Getter @Setter
|
||||||
public String min; // TODO: is this really used?
|
public String min; // TODO: is this really used?
|
||||||
|
@Getter @Setter
|
||||||
public String max; // TODO: is this really used?
|
public String max; // TODO: is this really used?
|
||||||
|
@Getter @Setter
|
||||||
public String defaultValue;
|
public String defaultValue;
|
||||||
|
@Getter @Setter
|
||||||
public String defaultValueWithParam;
|
public String defaultValueWithParam;
|
||||||
public String baseType;
|
@Setter public String baseType;
|
||||||
|
@Getter @Setter
|
||||||
public String containerType;
|
public String containerType;
|
||||||
|
@Getter @Setter
|
||||||
public String containerTypeMapped; // language-specified container type (e.g. `dict` in python for map)
|
public String containerTypeMapped; // language-specified container type (e.g. `dict` in python for map)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value of the 'title' attribute in the OpenAPI schema.
|
* The value of the 'title' attribute in the OpenAPI schema.
|
||||||
*/
|
*/
|
||||||
|
@Getter @Setter
|
||||||
public String title;
|
public String title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The 'description' string without escape characters needed by some programming languages/targets
|
* The 'description' string without escape characters needed by some programming languages/targets
|
||||||
*/
|
*/
|
||||||
|
@Getter @Setter
|
||||||
public String unescapedDescription;
|
public String unescapedDescription;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,8 +101,10 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
/**
|
/**
|
||||||
* A free-form property to include an example of an instance for this schema.
|
* A free-form property to include an example of an instance for this schema.
|
||||||
*/
|
*/
|
||||||
|
@Getter @Setter
|
||||||
public String example;
|
public String example;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
public String jsonSchema;
|
public String jsonSchema;
|
||||||
/**
|
/**
|
||||||
* The value of the 'minimum' attribute in the OpenAPI schema.
|
* The value of the 'minimum' attribute in the OpenAPI schema.
|
||||||
@ -110,7 +131,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
* The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance.
|
* The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance.
|
||||||
*/
|
*/
|
||||||
public boolean exclusiveMaximum;
|
public boolean exclusiveMaximum;
|
||||||
public boolean required;
|
@Setter public boolean required;
|
||||||
public boolean deprecated;
|
public boolean deprecated;
|
||||||
public boolean hasMoreNonReadOnly; // for model constructor, true if next property is not readonly
|
public boolean hasMoreNonReadOnly; // for model constructor, true if next property is not readonly
|
||||||
public boolean isPrimitiveType;
|
public boolean isPrimitiveType;
|
||||||
@ -170,7 +191,9 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
public boolean isDiscriminator;
|
public boolean isDiscriminator;
|
||||||
public boolean isNew; // true when this property overrides an inherited property
|
public boolean isNew; // true when this property overrides an inherited property
|
||||||
public Boolean isOverridden; // true if the property is a parent property (not defined in child/current schema)
|
public Boolean isOverridden; // true if the property is a parent property (not defined in child/current schema)
|
||||||
|
@Getter @Setter
|
||||||
public List<String> _enum;
|
public List<String> _enum;
|
||||||
|
@Getter @Setter
|
||||||
public Map<String, Object> allowableValues;
|
public Map<String, Object> allowableValues;
|
||||||
// If 'additionalProperties' is not set, items is null.
|
// If 'additionalProperties' is not set, items is null.
|
||||||
// If 'additionalProperties' is set to a type or refers to a type, 'items' provides the type information for
|
// If 'additionalProperties' is set to a type or refers to a type, 'items' provides the type information for
|
||||||
@ -180,16 +203,22 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>(); // all properties (without parent's properties)
|
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>(); // all properties (without parent's properties)
|
||||||
public List<CodegenProperty> requiredVars = new ArrayList<>();
|
public List<CodegenProperty> requiredVars = new ArrayList<>();
|
||||||
public CodegenProperty mostInnerItems;
|
public CodegenProperty mostInnerItems;
|
||||||
|
@Getter @Setter
|
||||||
public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
|
public Map<String, Object> vendorExtensions = new HashMap<String, Object>();
|
||||||
public boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
|
public boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
|
||||||
public boolean isInherited;
|
public boolean isInherited;
|
||||||
public String discriminatorValue;
|
public String discriminatorValue;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
public String nameInLowerCase; // property name in lower case
|
public String nameInLowerCase; // property name in lower case
|
||||||
|
@Getter @Setter
|
||||||
public String nameInCamelCase; // property name in camel case (e.g. modifiedDate)
|
public String nameInCamelCase; // property name in camel case (e.g. modifiedDate)
|
||||||
|
@Getter @Setter
|
||||||
public String nameInPascalCase; // property name in pascal case (e.g. ModifiedDate)
|
public String nameInPascalCase; // property name in pascal case (e.g. ModifiedDate)
|
||||||
|
@Getter
|
||||||
public String nameInSnakeCase; // property name in upper snake case
|
public String nameInSnakeCase; // property name in upper snake case
|
||||||
// enum name based on the property name, usually use as a prefix (e.g. VAR_NAME) for enum name (e.g. VAR_NAME_VALUE1)
|
// enum name based on the property name, usually use as a prefix (e.g. VAR_NAME) for enum name (e.g. VAR_NAME_VALUE1)
|
||||||
|
@Getter @Setter
|
||||||
public String enumName;
|
public String enumName;
|
||||||
public Integer maxItems;
|
public Integer maxItems;
|
||||||
public Integer minItems;
|
public Integer minItems;
|
||||||
@ -201,8 +230,11 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
|
|
||||||
// XML
|
// XML
|
||||||
public boolean isXmlAttribute = false;
|
public boolean isXmlAttribute = false;
|
||||||
|
@Getter @Setter
|
||||||
public String xmlPrefix;
|
public String xmlPrefix;
|
||||||
|
@Getter @Setter
|
||||||
public String xmlName;
|
public String xmlName;
|
||||||
|
@Getter @Setter
|
||||||
public String xmlNamespace;
|
public String xmlNamespace;
|
||||||
public boolean isXmlWrapped = false;
|
public boolean isXmlWrapped = false;
|
||||||
private boolean additionalPropertiesIsAnyType;
|
private boolean additionalPropertiesIsAnyType;
|
||||||
@ -270,48 +302,11 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
this.isBooleanSchemaFalse = isBooleanSchemaFalse;
|
this.isBooleanSchemaFalse = isBooleanSchemaFalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOpenApiType() { return openApiType; }
|
@Override
|
||||||
|
|
||||||
public String getBaseName() {
|
|
||||||
return baseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBaseName(String baseName) {
|
|
||||||
this.baseName = baseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getComplexType() {
|
public String getComplexType() {
|
||||||
return complexType;
|
return complexType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComplexType(String complexType) {
|
|
||||||
this.complexType = complexType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGetter() {
|
|
||||||
return getter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGetter(String getter) {
|
|
||||||
this.getter = getter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSetter() {
|
|
||||||
return setter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSetter(String setter) {
|
|
||||||
this.setter = setter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return dataType
|
* @return dataType
|
||||||
* @deprecated since version 3.0.0, use {@link #getDataType()} instead.<br>
|
* @deprecated since version 3.0.0, use {@link #getDataType()} instead.<br>
|
||||||
@ -322,119 +317,29 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
return getDataType();
|
return getDataType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getDataType() {
|
public String getDataType() {
|
||||||
return dataType;
|
return dataType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated use {@link #setDataType()} instead.
|
* @deprecated use {@link #setDataType(String)} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setDatatype(String datatype) {
|
public void setDatatype(String datatype) {
|
||||||
this.dataType = datatype;
|
this.dataType = datatype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setDataType(String dataType) {
|
public void setDataType(String dataType) {
|
||||||
this.dataType = dataType;
|
this.dataType = dataType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDatatypeWithEnum() {
|
@Override
|
||||||
return datatypeWithEnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDatatypeWithEnum(String datatypeWithEnum) {
|
|
||||||
this.datatypeWithEnum = datatypeWithEnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataFormat() {
|
|
||||||
return dataFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataFormat(String dataFormat) {
|
|
||||||
this.dataFormat = dataFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMin() {
|
|
||||||
return min;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMin(String min) {
|
|
||||||
this.min = min;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMax() {
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMax(String max) {
|
|
||||||
this.max = max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultValue() {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefaultValue(String defaultValue) {
|
|
||||||
this.defaultValue = defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultValueWithParam() {
|
|
||||||
return defaultValueWithParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDefaultValueWithParam(String defaultValueWithParam) {
|
|
||||||
this.defaultValueWithParam = defaultValueWithParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBaseType() {
|
public String getBaseType() {
|
||||||
return baseType;
|
return baseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBaseType(String baseType) {
|
|
||||||
this.baseType = baseType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getContainerType() {
|
|
||||||
return containerType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContainerType(String containerType) {
|
|
||||||
this.containerType = containerType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getContainerTypeMapped() {
|
|
||||||
return containerTypeMapped;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContainerTypeMapped(String containerTypeMapped) {
|
|
||||||
this.containerTypeMapped = containerTypeMapped;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTitle(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnescapedDescription() {
|
|
||||||
return unescapedDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUnescapedDescription(String unescapedDescription) {
|
|
||||||
this.unescapedDescription = unescapedDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getSchemaIsFromAdditionalProperties() {
|
public boolean getSchemaIsFromAdditionalProperties() {
|
||||||
return schemaIsFromAdditionalProperties;
|
return schemaIsFromAdditionalProperties;
|
||||||
@ -475,22 +380,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
this.pattern = pattern;
|
this.pattern = pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExample() {
|
|
||||||
return example;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExample(String example) {
|
|
||||||
this.example = example;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getJsonSchema() {
|
|
||||||
return jsonSchema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJsonSchema(String jsonSchema) {
|
|
||||||
this.jsonSchema = jsonSchema;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMinimum() {
|
public String getMinimum() {
|
||||||
return minimum;
|
return minimum;
|
||||||
@ -547,26 +436,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
return !getRequired() || isNullable;
|
return !getRequired() || isNullable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRequired(boolean required) {
|
|
||||||
this.required = required;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> get_enum() {
|
|
||||||
return _enum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void set_enum(List<String> _enum) {
|
|
||||||
this._enum = _enum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> getAllowableValues() {
|
|
||||||
return allowableValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowableValues(Map<String, Object> allowableValues) {
|
|
||||||
this.allowableValues = allowableValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodegenProperty getItems() {
|
public CodegenProperty getItems() {
|
||||||
return items;
|
return items;
|
||||||
@ -687,50 +556,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
this.isPrimitiveType = isPrimitiveType;
|
this.isPrimitiveType = isPrimitiveType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getVendorExtensions() {
|
|
||||||
return vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVendorExtensions(Map<String, Object> vendorExtensions) {
|
|
||||||
this.vendorExtensions = vendorExtensions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNameInLowerCase() {
|
|
||||||
return nameInLowerCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNameInLowerCase(String nameInLowerCase) {
|
|
||||||
this.nameInLowerCase = nameInLowerCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNameInCamelCase() {
|
|
||||||
return nameInCamelCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNameInCamelCase(String nameInCamelCase) {
|
|
||||||
this.nameInCamelCase = nameInCamelCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNameInPascalCase() {
|
|
||||||
return nameInPascalCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNameInPascalCase(String nameInPascalCase) {
|
|
||||||
this.nameInPascalCase = nameInPascalCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNameInSnakeCase() {
|
|
||||||
return nameInSnakeCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnumName() {
|
|
||||||
return enumName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnumName(String enumName) {
|
|
||||||
this.enumName = enumName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer getMaxItems() {
|
public Integer getMaxItems() {
|
||||||
return maxItems;
|
return maxItems;
|
||||||
@ -751,30 +576,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
this.minItems = minItems;
|
this.minItems = minItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getXmlPrefix() {
|
|
||||||
return xmlPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setXmlPrefix(String xmlPrefix) {
|
|
||||||
this.xmlPrefix = xmlPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getXmlName() {
|
|
||||||
return xmlName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setXmlName(String xmlName) {
|
|
||||||
this.xmlName = xmlName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getXmlNamespace() {
|
|
||||||
return xmlNamespace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setXmlNamespace(String xmlNamespace) {
|
|
||||||
this.xmlNamespace = xmlNamespace;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setComposedSchemas(CodegenComposedSchemas composedSchemas) {
|
public void setComposedSchemas(CodegenComposedSchemas composedSchemas) {
|
||||||
this.composedSchemas = composedSchemas;
|
this.composedSchemas = composedSchemas;
|
||||||
@ -983,8 +784,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
return hasDiscriminatorWithNonEmptyMapping;
|
return hasDiscriminatorWithNonEmptyMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) {
|
public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) {
|
||||||
this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping;
|
this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping;
|
||||||
@ -1044,10 +843,12 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
this.hasMultipleTypes = hasMultipleTypes;
|
this.hasMultipleTypes = hasMultipleTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getIsUuid() {
|
public boolean getIsUuid() {
|
||||||
return isUuid;
|
return isUuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setIsUuid(boolean isUuid) {
|
public void setIsUuid(boolean isUuid) {
|
||||||
this.isUuid = isUuid;
|
this.isUuid = isUuid;
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,14 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class CodegenResponse implements IJsonSchemaValidationProperties {
|
public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||||
public final List<CodegenProperty> headers = new ArrayList<CodegenProperty>();
|
public final List<CodegenProperty> headers = new ArrayList<CodegenProperty>();
|
||||||
|
@Getter @Setter
|
||||||
private List<CodegenParameter> responseHeaders = new ArrayList<CodegenParameter>();
|
private List<CodegenParameter> responseHeaders = new ArrayList<CodegenParameter>();
|
||||||
public String code;
|
public String code;
|
||||||
public boolean is1xx;
|
public boolean is1xx;
|
||||||
@ -94,6 +98,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
private boolean hasDiscriminatorWithNonEmptyMapping;
|
private boolean hasDiscriminatorWithNonEmptyMapping;
|
||||||
private CodegenComposedSchemas composedSchemas;
|
private CodegenComposedSchemas composedSchemas;
|
||||||
private boolean hasMultipleTypes = false;
|
private boolean hasMultipleTypes = false;
|
||||||
|
@Getter @Setter
|
||||||
private LinkedHashMap<String, CodegenMediaType> content;
|
private LinkedHashMap<String, CodegenMediaType> content;
|
||||||
private Map<String, CodegenProperty> requiredVarsMap;
|
private Map<String, CodegenProperty> requiredVarsMap;
|
||||||
private String ref;
|
private String ref;
|
||||||
@ -249,22 +254,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
@Override
|
@Override
|
||||||
public void setFormat(String format) {}
|
public void setFormat(String format) {}
|
||||||
|
|
||||||
public LinkedHashMap<String, CodegenMediaType> getContent() {
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContent(LinkedHashMap<String, CodegenMediaType> content) {
|
|
||||||
this.content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CodegenParameter> getResponseHeaders() {
|
|
||||||
return responseHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResponseHeaders(List<CodegenParameter> responseHeaders) {
|
|
||||||
this.responseHeaders = responseHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPattern() {
|
public String getPattern() {
|
||||||
return pattern;
|
return pattern;
|
||||||
@ -722,8 +711,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
return hasDiscriminatorWithNonEmptyMapping;
|
return hasDiscriminatorWithNonEmptyMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) {
|
public void setHasDiscriminatorWithNonEmptyMapping(boolean hasDiscriminatorWithNonEmptyMapping) {
|
||||||
this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping;
|
this.hasDiscriminatorWithNonEmptyMapping = hasDiscriminatorWithNonEmptyMapping;
|
||||||
|
@ -42,6 +42,8 @@ import io.swagger.v3.oas.models.security.SecurityScheme;
|
|||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
import io.swagger.v3.oas.models.servers.ServerVariable;
|
import io.swagger.v3.oas.models.servers.ServerVariable;
|
||||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.apache.commons.text.StringEscapeUtils;
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
@ -181,12 +183,15 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
protected Map<String, String> operationIdNameMapping = new HashMap<>();
|
protected Map<String, String> operationIdNameMapping = new HashMap<>();
|
||||||
// a map to store the rules in OpenAPI Normalizer
|
// a map to store the rules in OpenAPI Normalizer
|
||||||
protected Map<String, String> openapiNormalizer = new HashMap<>();
|
protected Map<String, String> openapiNormalizer = new HashMap<>();
|
||||||
protected String modelPackage = "", apiPackage = "", fileSuffix;
|
@Setter protected String modelPackage = "", apiPackage = "";
|
||||||
|
protected String fileSuffix;
|
||||||
|
@Getter @Setter
|
||||||
protected String modelNamePrefix = "", modelNameSuffix = "";
|
protected String modelNamePrefix = "", modelNameSuffix = "";
|
||||||
|
@Getter @Setter
|
||||||
protected String apiNamePrefix = "", apiNameSuffix = "Api";
|
protected String apiNamePrefix = "", apiNameSuffix = "Api";
|
||||||
protected String testPackage = "";
|
protected String testPackage = "";
|
||||||
protected String filesMetadataFilename = "FILES";
|
@Setter protected String filesMetadataFilename = "FILES";
|
||||||
protected String versionMetadataFilename = "VERSION";
|
@Setter protected String versionMetadataFilename = "VERSION";
|
||||||
/*
|
/*
|
||||||
apiTemplateFiles are for API outputs only (controllers/handlers).
|
apiTemplateFiles are for API outputs only (controllers/handlers).
|
||||||
API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group.
|
API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group.
|
||||||
@ -198,7 +203,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
protected Map<String, String> apiDocTemplateFiles = new HashMap<>();
|
protected Map<String, String> apiDocTemplateFiles = new HashMap<>();
|
||||||
protected Map<String, String> modelDocTemplateFiles = new HashMap<>();
|
protected Map<String, String> modelDocTemplateFiles = new HashMap<>();
|
||||||
protected Map<String, String> reservedWordsMappings = new HashMap<>();
|
protected Map<String, String> reservedWordsMappings = new HashMap<>();
|
||||||
protected String templateDir;
|
@Setter protected String templateDir;
|
||||||
protected String embeddedTemplateDir;
|
protected String embeddedTemplateDir;
|
||||||
protected Map<String, Object> additionalProperties = new HashMap<>();
|
protected Map<String, Object> additionalProperties = new HashMap<>();
|
||||||
protected Map<String, String> serverVariables = new HashMap<>();
|
protected Map<String, String> serverVariables = new HashMap<>();
|
||||||
@ -213,7 +218,9 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
protected List<CliOption> cliOptions = new ArrayList<>();
|
protected List<CliOption> cliOptions = new ArrayList<>();
|
||||||
protected boolean skipOverwrite;
|
protected boolean skipOverwrite;
|
||||||
protected boolean removeOperationIdPrefix;
|
protected boolean removeOperationIdPrefix;
|
||||||
|
@Getter @Setter
|
||||||
protected String removeOperationIdPrefixDelimiter = "_";
|
protected String removeOperationIdPrefixDelimiter = "_";
|
||||||
|
@Getter @Setter
|
||||||
protected int removeOperationIdPrefixCount = 1;
|
protected int removeOperationIdPrefixCount = 1;
|
||||||
protected boolean skipOperationExample;
|
protected boolean skipOperationExample;
|
||||||
|
|
||||||
@ -246,9 +253,13 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
protected boolean supportsMixins;
|
protected boolean supportsMixins;
|
||||||
protected Map<String, String> supportedLibraries = new LinkedHashMap<>();
|
protected Map<String, String> supportedLibraries = new LinkedHashMap<>();
|
||||||
protected String library;
|
protected String library;
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean sortParamsByRequiredFlag = true;
|
protected Boolean sortParamsByRequiredFlag = true;
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean sortModelPropertiesByRequiredFlag = false;
|
protected Boolean sortModelPropertiesByRequiredFlag = false;
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean ensureUniqueParams = true;
|
protected Boolean ensureUniqueParams = true;
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean allowUnicodeIdentifiers = false;
|
protected Boolean allowUnicodeIdentifiers = false;
|
||||||
protected String gitHost, gitUserId, gitRepoId, releaseNote;
|
protected String gitHost, gitUserId, gitRepoId, releaseNote;
|
||||||
protected String httpUserAgent;
|
protected String httpUserAgent;
|
||||||
@ -259,6 +270,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
protected Map<String, String> specialCharReplacements = new LinkedHashMap<>();
|
protected Map<String, String> specialCharReplacements = new LinkedHashMap<>();
|
||||||
// When a model is an alias for a simple type
|
// When a model is an alias for a simple type
|
||||||
protected Map<String, String> typeAliases = Collections.emptyMap();
|
protected Map<String, String> typeAliases = Collections.emptyMap();
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean prependFormOrBodyParameters = false;
|
protected Boolean prependFormOrBodyParameters = false;
|
||||||
// The extension of the generated documentation files (defaults to markdown .md)
|
// The extension of the generated documentation files (defaults to markdown .md)
|
||||||
protected String docExtension;
|
protected String docExtension;
|
||||||
@ -281,15 +293,15 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
protected boolean removeEnumValuePrefix = true;
|
protected boolean removeEnumValuePrefix = true;
|
||||||
|
|
||||||
// Support legacy logic for evaluating discriminators
|
// Support legacy logic for evaluating discriminators
|
||||||
protected boolean legacyDiscriminatorBehavior = true;
|
@Setter protected boolean legacyDiscriminatorBehavior = true;
|
||||||
|
|
||||||
// Specify what to do if the 'additionalProperties' keyword is not present in a schema.
|
// Specify what to do if the 'additionalProperties' keyword is not present in a schema.
|
||||||
// See CodegenConstants.java for more details.
|
// See CodegenConstants.java for more details.
|
||||||
protected boolean disallowAdditionalPropertiesIfNotPresent = true;
|
@Setter protected boolean disallowAdditionalPropertiesIfNotPresent = true;
|
||||||
|
|
||||||
// If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.
|
// If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.
|
||||||
// With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.
|
// With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.
|
||||||
protected boolean enumUnknownDefaultCase = false;
|
@Setter protected boolean enumUnknownDefaultCase = false;
|
||||||
protected String enumUnknownDefaultCaseName = "unknown_default_open_api";
|
protected String enumUnknownDefaultCaseName = "unknown_default_open_api";
|
||||||
|
|
||||||
// make openapi available to all methods
|
// make openapi available to all methods
|
||||||
@ -312,8 +324,9 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
protected boolean addSuffixToDuplicateOperationNicknames = true;
|
protected boolean addSuffixToDuplicateOperationNicknames = true;
|
||||||
|
|
||||||
// Whether to automatically hardcode params that are considered Constants by OpenAPI Spec
|
// Whether to automatically hardcode params that are considered Constants by OpenAPI Spec
|
||||||
protected boolean autosetConstants = false;
|
@Setter protected boolean autosetConstants = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getAddSuffixToDuplicateOperationNicknames() {
|
public boolean getAddSuffixToDuplicateOperationNicknames() {
|
||||||
return addSuffixToDuplicateOperationNicknames;
|
return addSuffixToDuplicateOperationNicknames;
|
||||||
}
|
}
|
||||||
@ -1456,127 +1469,23 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
return filesMetadataFilename;
|
return filesMetadataFilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFilesMetadataFilename(String filesMetadataFilename) {
|
|
||||||
this.filesMetadataFilename = filesMetadataFilename;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVersionMetadataFilename() {
|
public String getVersionMetadataFilename() {
|
||||||
return versionMetadataFilename;
|
return versionMetadataFilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVersionMetadataFilename(String versionMetadataFilename) {
|
|
||||||
this.versionMetadataFilename = versionMetadataFilename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTemplateDir(String templateDir) {
|
|
||||||
this.templateDir = templateDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModelPackage(String modelPackage) {
|
|
||||||
this.modelPackage = modelPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getModelNamePrefix() {
|
|
||||||
return modelNamePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModelNamePrefix(String modelNamePrefix) {
|
|
||||||
this.modelNamePrefix = modelNamePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getModelNameSuffix() {
|
|
||||||
return modelNameSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModelNameSuffix(String modelNameSuffix) {
|
|
||||||
this.modelNameSuffix = modelNameSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getApiNameSuffix() {
|
|
||||||
return apiNameSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApiNameSuffix(String apiNameSuffix) {
|
|
||||||
this.apiNameSuffix = apiNameSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getApiNamePrefix() {
|
|
||||||
return apiNamePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApiNamePrefix(String apiNamePrefix) {
|
|
||||||
this.apiNamePrefix = apiNamePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApiPackage(String apiPackage) {
|
|
||||||
this.apiPackage = apiPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSortParamsByRequiredFlag() {
|
|
||||||
return sortParamsByRequiredFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSortParamsByRequiredFlag(Boolean sortParamsByRequiredFlag) {
|
|
||||||
this.sortParamsByRequiredFlag = sortParamsByRequiredFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSortModelPropertiesByRequiredFlag() {
|
|
||||||
return sortModelPropertiesByRequiredFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSortModelPropertiesByRequiredFlag(Boolean sortModelPropertiesByRequiredFlag) {
|
|
||||||
this.sortModelPropertiesByRequiredFlag = sortModelPropertiesByRequiredFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getPrependFormOrBodyParameters() {
|
|
||||||
return prependFormOrBodyParameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrependFormOrBodyParameters(Boolean prependFormOrBodyParameters) {
|
|
||||||
this.prependFormOrBodyParameters = prependFormOrBodyParameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getEnsureUniqueParams() {
|
|
||||||
return ensureUniqueParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnsureUniqueParams(Boolean ensureUniqueParams) {
|
|
||||||
this.ensureUniqueParams = ensureUniqueParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getLegacyDiscriminatorBehavior() {
|
public Boolean getLegacyDiscriminatorBehavior() {
|
||||||
return legacyDiscriminatorBehavior;
|
return legacyDiscriminatorBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLegacyDiscriminatorBehavior(boolean val) {
|
|
||||||
this.legacyDiscriminatorBehavior = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getDisallowAdditionalPropertiesIfNotPresent() {
|
public Boolean getDisallowAdditionalPropertiesIfNotPresent() {
|
||||||
return disallowAdditionalPropertiesIfNotPresent;
|
return disallowAdditionalPropertiesIfNotPresent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDisallowAdditionalPropertiesIfNotPresent(boolean val) {
|
|
||||||
this.disallowAdditionalPropertiesIfNotPresent = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getEnumUnknownDefaultCase() {
|
public Boolean getEnumUnknownDefaultCase() {
|
||||||
return enumUnknownDefaultCase;
|
return enumUnknownDefaultCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnumUnknownDefaultCase(boolean val) {
|
|
||||||
this.enumUnknownDefaultCase = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getAllowUnicodeIdentifiers() {
|
|
||||||
return allowUnicodeIdentifiers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers) {
|
|
||||||
this.allowUnicodeIdentifiers = allowUnicodeIdentifiers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getUseOneOfInterfaces() {
|
public Boolean getUseOneOfInterfaces() {
|
||||||
return useOneOfInterfaces;
|
return useOneOfInterfaces;
|
||||||
}
|
}
|
||||||
@ -6277,22 +6186,6 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
this.removeOperationIdPrefix = removeOperationIdPrefix;
|
this.removeOperationIdPrefix = removeOperationIdPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemoveOperationIdPrefixDelimiter() {
|
|
||||||
return removeOperationIdPrefixDelimiter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemoveOperationIdPrefixDelimiter(String removeOperationIdPrefixDelimiter) {
|
|
||||||
this.removeOperationIdPrefixDelimiter = removeOperationIdPrefixDelimiter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRemoveOperationIdPrefixCount() {
|
|
||||||
return removeOperationIdPrefixCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemoveOperationIdPrefixCount(int removeOperationIdPrefixCount) {
|
|
||||||
this.removeOperationIdPrefixCount = removeOperationIdPrefixCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSkipOperationExample(boolean skipOperationExample) {
|
public void setSkipOperationExample(boolean skipOperationExample) {
|
||||||
this.skipOperationExample = skipOperationExample;
|
this.skipOperationExample = skipOperationExample;
|
||||||
@ -8302,7 +8195,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
/**
|
/**
|
||||||
* An map entry for cached sanitized names.
|
* An map entry for cached sanitized names.
|
||||||
*/
|
*/
|
||||||
private static class SanitizeNameOptions {
|
@Getter private static class SanitizeNameOptions {
|
||||||
public SanitizeNameOptions(String name, String removeCharRegEx, List<String> exceptions) {
|
public SanitizeNameOptions(String name, String removeCharRegEx, List<String> exceptions) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.removeCharRegEx = removeCharRegEx;
|
this.removeCharRegEx = removeCharRegEx;
|
||||||
@ -8313,18 +8206,6 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemoveCharRegEx() {
|
|
||||||
return removeCharRegEx;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getExceptions() {
|
|
||||||
return exceptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final String removeCharRegEx;
|
private final String removeCharRegEx;
|
||||||
private final List<String> exceptions;
|
private final List<String> exceptions;
|
||||||
@ -8533,10 +8414,6 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAutosetConstants(boolean autosetConstants) {
|
|
||||||
this.autosetConstants = autosetConstants;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method removes all constant Query, Header and Cookie Params from allParams and sets them as constantParams in the CodegenOperation.
|
* This method removes all constant Query, Header and Cookie Params from allParams and sets them as constantParams in the CodegenOperation.
|
||||||
* The definition of constant is single valued required enum params.
|
* The definition of constant is single valued required enum params.
|
||||||
|
@ -29,7 +29,7 @@ import io.swagger.v3.oas.models.media.Schema;
|
|||||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||||
import io.swagger.v3.oas.models.security.*;
|
import io.swagger.v3.oas.models.security.*;
|
||||||
import io.swagger.v3.oas.models.tags.Tag;
|
import io.swagger.v3.oas.models.tags.Tag;
|
||||||
|
import lombok.Getter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.io.comparator.PathFileComparator;
|
import org.apache.commons.io.comparator.PathFileComparator;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
@ -95,7 +95,15 @@ public class DefaultGenerator implements Generator {
|
|||||||
private String basePathWithoutHost;
|
private String basePathWithoutHost;
|
||||||
private String contextPath;
|
private String contextPath;
|
||||||
private Map<String, String> generatorPropertyDefaults = new HashMap<>();
|
private Map<String, String> generatorPropertyDefaults = new HashMap<>();
|
||||||
protected TemplateProcessor templateProcessor = null;
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Retrieves an instance to the configured template processor, available after user-defined options are
|
||||||
|
* applied via
|
||||||
|
* .
|
||||||
|
*
|
||||||
|
* @return A configured {@link TemplateProcessor}, or null.
|
||||||
|
*/
|
||||||
|
@Getter protected TemplateProcessor templateProcessor = null;
|
||||||
|
|
||||||
private List<TemplateDefinition> userDefinedTemplates = new ArrayList<>();
|
private List<TemplateDefinition> userDefinedTemplates = new ArrayList<>();
|
||||||
private String generatorCheck = "spring";
|
private String generatorCheck = "spring";
|
||||||
@ -160,16 +168,6 @@ public class DefaultGenerator implements Generator {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieves an instance to the configured template processor, available after user-defined options are
|
|
||||||
* applied via {@link DefaultGenerator#opts(ClientOptInput)}.
|
|
||||||
*
|
|
||||||
* @return A configured {@link TemplateProcessor}, or null.
|
|
||||||
*/
|
|
||||||
public TemplateProcessor getTemplateProcessor() {
|
|
||||||
return templateProcessor;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore,
|
* Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore,
|
||||||
* or other metadata files used by OpenAPI Generator.
|
* or other metadata files used by OpenAPI Generator.
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -7,9 +9,28 @@ import java.util.Locale;
|
|||||||
/**
|
/**
|
||||||
* Holds details about a file's write status for display via the --dry-run option of CLI
|
* Holds details about a file's write status for display via the --dry-run option of CLI
|
||||||
*/
|
*/
|
||||||
class DryRunStatus {
|
@Getter class DryRunStatus {
|
||||||
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Gets the target path of the file write operation
|
||||||
|
*
|
||||||
|
* @return a {@link Path} instance
|
||||||
|
*/
|
||||||
private Path path;
|
private Path path;
|
||||||
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Gets the
|
||||||
|
* as determined by the generator's workflow
|
||||||
|
*
|
||||||
|
* @return A {@link State} enum detailing the expected operation of the generator's workflow
|
||||||
|
*/
|
||||||
private State state;
|
private State state;
|
||||||
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Gets the reason for the file's
|
||||||
|
*
|
||||||
|
* @return A human-readable string which explains why this file's dry-run resulted in the defined {@link State}
|
||||||
|
*/
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,33 +76,6 @@ class DryRunStatus {
|
|||||||
appendable.append(String.format(Locale.ROOT, "%s %s", this.state.getShortDisplay(), this.path.toAbsolutePath()));
|
appendable.append(String.format(Locale.ROOT, "%s %s", this.state.getShortDisplay(), this.path.toAbsolutePath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the target path of the file write operation
|
|
||||||
*
|
|
||||||
* @return a {@link Path} instance
|
|
||||||
*/
|
|
||||||
public Path getPath() {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the reason for the file's {@link State}
|
|
||||||
*
|
|
||||||
* @return A human-readable string which explains why this file's dry-run resulted in the defined {@link State}
|
|
||||||
*/
|
|
||||||
public String getReason() {
|
|
||||||
return reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the {@link State} as determined by the generator's workflow
|
|
||||||
*
|
|
||||||
* @return A {@link State} enum detailing the expected operation of the generator's workflow
|
|
||||||
*/
|
|
||||||
public State getState() {
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the {@link State} as determined by the generator's workflow.
|
* Sets the {@link State} as determined by the generator's workflow.
|
||||||
* <p>
|
* <p>
|
||||||
@ -116,7 +110,7 @@ class DryRunStatus {
|
|||||||
/**
|
/**
|
||||||
* Represents the possible states of a file write operation as determined by the Generator
|
* Represents the possible states of a file write operation as determined by the Generator
|
||||||
*/
|
*/
|
||||||
enum State {
|
@Getter enum State {
|
||||||
Write("w", "Write"),
|
Write("w", "Write"),
|
||||||
WriteIfNewer("n", "Write if New/Updated"),
|
WriteIfNewer("n", "Write if New/Updated"),
|
||||||
Ignored("i", "Ignored"),
|
Ignored("i", "Ignored"),
|
||||||
@ -124,7 +118,19 @@ class DryRunStatus {
|
|||||||
Skipped("k", "Skipped by user option(s)"),
|
Skipped("k", "Skipped by user option(s)"),
|
||||||
Error("e", "Error evaluating file write state");
|
Error("e", "Error evaluating file write state");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Gets the short value used for display
|
||||||
|
*
|
||||||
|
* @return A character representing this state
|
||||||
|
*/
|
||||||
private final String shortDisplay;
|
private final String shortDisplay;
|
||||||
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Gets a description of the state which is more human-readable than the enum's name
|
||||||
|
*
|
||||||
|
* @return A human-readable description
|
||||||
|
*/
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,22 +145,5 @@ class DryRunStatus {
|
|||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a description of the state which is more human-readable than the enum's name
|
|
||||||
*
|
|
||||||
* @return A human-readable description
|
|
||||||
*/
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the short value used for display
|
|
||||||
*
|
|
||||||
* @return A character representing this state
|
|
||||||
*/
|
|
||||||
public String getShortDisplay() {
|
|
||||||
return shortDisplay;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -119,7 +119,7 @@ public interface IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
boolean getIsArray();
|
boolean getIsArray();
|
||||||
|
|
||||||
void setIsArray(boolean isShort);
|
void setIsArray(boolean isArray);
|
||||||
|
|
||||||
boolean getIsShort();
|
boolean getIsShort();
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ public interface IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
boolean getIsString();
|
boolean getIsString();
|
||||||
|
|
||||||
void setIsString(boolean isNumber);
|
void setIsString(boolean isString);
|
||||||
|
|
||||||
boolean getIsNumber();
|
boolean getIsNumber();
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ public interface IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
boolean getIsDouble();
|
boolean getIsDouble();
|
||||||
|
|
||||||
void setIsInteger(boolean isDouble);
|
void setIsInteger(boolean isInteger);
|
||||||
|
|
||||||
boolean getIsInteger();
|
boolean getIsInteger();
|
||||||
|
|
||||||
@ -290,7 +290,6 @@ public interface IJsonSchemaValidationProperties {
|
|||||||
setIsArray(true);
|
setIsArray(true);
|
||||||
} else if (ModelUtils.isFileSchema(p) && !ModelUtils.isStringSchema(p)) {
|
} else if (ModelUtils.isFileSchema(p) && !ModelUtils.isStringSchema(p)) {
|
||||||
// swagger v2 only, type file
|
// swagger v2 only, type file
|
||||||
;
|
|
||||||
} else if (ModelUtils.isStringSchema(p)) {
|
} else if (ModelUtils.isStringSchema(p)) {
|
||||||
setIsString(true);
|
setIsString(true);
|
||||||
if (ModelUtils.isByteArraySchema(p)) {
|
if (ModelUtils.isByteArraySchema(p)) {
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
public class SpecValidationException extends RuntimeException {
|
public class SpecValidationException extends RuntimeException {
|
||||||
|
|
||||||
private Set<String> errors;
|
private Set<String> errors;
|
||||||
@ -81,22 +85,6 @@ public class SpecValidationException extends RuntimeException {
|
|||||||
super(message, cause, enableSuppression, writableStackTrace);
|
super(message, cause, enableSuppression, writableStackTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getErrors() {
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getWarnings() {
|
|
||||||
return warnings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setErrors(Set<String> errors) {
|
|
||||||
this.errors = errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWarnings(Set<String> warnings) {
|
|
||||||
this.warnings = warnings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the detail message string of this throwable.
|
* Returns the detail message string of this throwable.
|
||||||
*
|
*
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
import org.openapitools.codegen.api.TemplateDefinition;
|
import org.openapitools.codegen.api.TemplateDefinition;
|
||||||
import org.openapitools.codegen.api.TemplateFileType;
|
import org.openapitools.codegen.api.TemplateFileType;
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ import java.util.StringJoiner;
|
|||||||
* Supporting files are generated once for an entire application while api/model bound definitions are generated multiple
|
* Supporting files are generated once for an entire application while api/model bound definitions are generated multiple
|
||||||
* times according to their target use.
|
* times according to their target use.
|
||||||
*/
|
*/
|
||||||
public class SupportingFile extends TemplateDefinition {
|
@Getter public class SupportingFile extends TemplateDefinition {
|
||||||
private boolean canOverwrite = true;
|
private boolean canOverwrite = true;
|
||||||
|
|
||||||
public SupportingFile(String templateFile, String destinationFilename) {
|
public SupportingFile(String templateFile, String destinationFilename) {
|
||||||
@ -80,10 +81,6 @@ public class SupportingFile extends TemplateDefinition {
|
|||||||
return isCanOverwrite() == that.isCanOverwrite();
|
return isCanOverwrite() == that.isCanOverwrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCanOverwrite() {
|
|
||||||
return canOverwrite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(super.hashCode(), isCanOverwrite());
|
return Objects.hash(super.hashCode(), isCanOverwrite());
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package org.openapitools.codegen;
|
package org.openapitools.codegen;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public enum VendorExtension {
|
@Getter public enum VendorExtension {
|
||||||
|
|
||||||
X_IMPLEMENTS("x-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implements", "empty array"),
|
X_IMPLEMENTS("x-implements", ExtensionLevel.MODEL, "Ability to specify interfaces that model must implements", "empty array"),
|
||||||
X_SPRING_PAGINATED("x-spring-paginated", ExtensionLevel.OPERATION, "Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters", "false"),
|
X_SPRING_PAGINATED("x-spring-paginated", ExtensionLevel.OPERATION, "Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters", "false"),
|
||||||
@ -38,22 +40,6 @@ public enum VendorExtension {
|
|||||||
this(name, Collections.singletonList(level), description, defaultValue);
|
this(name, Collections.singletonList(level), description, defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ExtensionLevel> getLevels() {
|
|
||||||
return levels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultValue() {
|
|
||||||
return defaultValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ExtensionLevel {
|
public enum ExtensionLevel {
|
||||||
FIELD,
|
FIELD,
|
||||||
MODEL,
|
MODEL,
|
||||||
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
import com.fasterxml.jackson.annotation.JsonUnwrapped;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import lombok.Getter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.api.TemplateDefinition;
|
import org.openapitools.codegen.api.TemplateDefinition;
|
||||||
import org.openapitools.codegen.api.TemplateFileType;
|
import org.openapitools.codegen.api.TemplateFileType;
|
||||||
@ -20,7 +21,13 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unused", "WeakerAccess"})
|
@SuppressWarnings({"unused", "WeakerAccess"})
|
||||||
public class DynamicSettings {
|
public class DynamicSettings {
|
||||||
@JsonAnySetter
|
/**
|
||||||
|
* -- GETTER --
|
||||||
|
* Gets all "custom" properties included in the config object.
|
||||||
|
*
|
||||||
|
* @return All user-specified custom properties.
|
||||||
|
*/
|
||||||
|
@Getter @JsonAnySetter
|
||||||
private Map<String, Object> dynamicProperties = new HashMap<>();
|
private Map<String, Object> dynamicProperties = new HashMap<>();
|
||||||
|
|
||||||
@JsonUnwrapped
|
@JsonUnwrapped
|
||||||
@ -91,15 +98,6 @@ public class DynamicSettings {
|
|||||||
@JsonCreator
|
@JsonCreator
|
||||||
public DynamicSettings() { }
|
public DynamicSettings() { }
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets all "custom" properties included in the config object.
|
|
||||||
*
|
|
||||||
* @return All user-specified custom properties.
|
|
||||||
*/
|
|
||||||
public Map<String, Object> getDynamicProperties() {
|
|
||||||
return dynamicProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void excludeSettingsFromDynamicProperties(){
|
private void excludeSettingsFromDynamicProperties(){
|
||||||
Set<String> fieldNames = new HashSet<>();
|
Set<String> fieldNames = new HashSet<>();
|
||||||
for (Field field : GeneratorSettings.class.getDeclaredFields()) {
|
for (Field field : GeneratorSettings.class.getDeclaredFields()) {
|
||||||
|
@ -45,7 +45,7 @@ public class GlobalSettings {
|
|||||||
Properties copy = new Properties();
|
Properties copy = new Properties();
|
||||||
copy.putAll(System.getProperties());
|
copy.putAll(System.getProperties());
|
||||||
return copy;
|
return copy;
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static String getProperty(String key, String defaultValue) {
|
public static String getProperty(String key, String defaultValue) {
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.examples;
|
package org.openapitools.codegen.examples;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.media.XML;
|
import io.swagger.v3.oas.models.media.XML;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -17,11 +17,13 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.ignore.rules;
|
package org.openapitools.codegen.ignore.rules;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class IgnoreLineParser {
|
public class IgnoreLineParser {
|
||||||
enum Token {
|
@Getter enum Token {
|
||||||
MATCH_ALL("**"),
|
MATCH_ALL("**"),
|
||||||
MATCH_ANY("*"),
|
MATCH_ANY("*"),
|
||||||
ESCAPED_EXCLAMATION("\\!"),
|
ESCAPED_EXCLAMATION("\\!"),
|
||||||
@ -39,9 +41,6 @@ public class IgnoreLineParser {
|
|||||||
this.pattern = pattern;
|
this.pattern = pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPattern() {
|
|
||||||
return pattern;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Comments that start with a : (e.g. //:) are pulled from git documentation for .gitignore
|
// NOTE: Comments that start with a : (e.g. //:) are pulled from git documentation for .gitignore
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.ignore.rules;
|
package org.openapitools.codegen.ignore.rules;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class InvalidRule extends Rule {
|
@Getter public class InvalidRule extends Rule {
|
||||||
private final String reason;
|
private final String reason;
|
||||||
|
|
||||||
InvalidRule(List<Part> syntax, String definition, String reason) {
|
InvalidRule(List<Part> syntax, String definition, String reason) {
|
||||||
@ -37,7 +39,4 @@ public class InvalidRule extends Rule {
|
|||||||
return Operation.NOOP;
|
return Operation.NOOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getReason() {
|
|
||||||
return reason;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.ignore.rules;
|
package org.openapitools.codegen.ignore.rules;
|
||||||
|
|
||||||
class Part {
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter class Part {
|
||||||
private final IgnoreLineParser.Token token;
|
private final IgnoreLineParser.Token token;
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
@ -31,11 +33,4 @@ class Part {
|
|||||||
this.value = token.getPattern();
|
this.value = token.getPattern();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IgnoreLineParser.Token getToken() {
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.ignore.rules;
|
package org.openapitools.codegen.ignore.rules;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class Rule {
|
public abstract class Rule {
|
||||||
@ -24,7 +26,7 @@ public abstract class Rule {
|
|||||||
public enum Operation {EXCLUDE, INCLUDE, NOOP, EXCLUDE_AND_TERMINATE}
|
public enum Operation {EXCLUDE, INCLUDE, NOOP, EXCLUDE_AND_TERMINATE}
|
||||||
|
|
||||||
// The original rule
|
// The original rule
|
||||||
private final String definition;
|
@Getter private final String definition;
|
||||||
|
|
||||||
private final List<Part> syntax;
|
private final List<Part> syntax;
|
||||||
|
|
||||||
@ -35,10 +37,6 @@ public abstract class Rule {
|
|||||||
|
|
||||||
public abstract Boolean matches(String relativePath);
|
public abstract Boolean matches(String relativePath);
|
||||||
|
|
||||||
public String getDefinition() {
|
|
||||||
return this.definition;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getPattern() {
|
protected String getPattern() {
|
||||||
if(syntax == null) return this.definition;
|
if(syntax == null) return this.definition;
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ package org.openapitools.codegen.languages;
|
|||||||
import com.samskivert.mustache.Escapers;
|
import com.samskivert.mustache.Escapers;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
@ -885,6 +884,7 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compareTo(ModelDepend second) {
|
public int compareTo(ModelDepend second) {
|
||||||
|
|
||||||
if (depend != null && depend.contains(second.name)) {
|
if (depend != null && depend.contains(second.name)) {
|
||||||
|
@ -19,11 +19,11 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.MapSchema;
|
import io.swagger.v3.oas.models.media.MapSchema;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.responses.ApiResponse;
|
import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.model.ModelsMap;
|
import org.openapitools.codegen.model.ModelsMap;
|
||||||
@ -39,7 +39,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize;
|
|||||||
public abstract class AbstractApexCodegen extends DefaultCodegen implements CodegenConfig {
|
public abstract class AbstractApexCodegen extends DefaultCodegen implements CodegenConfig {
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(AbstractApexCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(AbstractApexCodegen.class);
|
||||||
|
|
||||||
protected Boolean serializableModel = false;
|
@Setter protected Boolean serializableModel = false;
|
||||||
|
|
||||||
public AbstractApexCodegen() {
|
public AbstractApexCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -208,14 +208,6 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code
|
|||||||
return super.getTypeDeclaration(p);
|
return super.getTypeDeclaration(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAlias(String name) {
|
|
||||||
if (typeAliases != null && typeAliases.containsKey(name)) {
|
|
||||||
return typeAliases.get(name);
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toDefaultValue(Schema p) {
|
public String toDefaultValue(Schema p) {
|
||||||
if (ModelUtils.isArraySchema(p)) {
|
if (ModelUtils.isArraySchema(p)) {
|
||||||
@ -634,10 +626,6 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setSerializableModel(Boolean serializableModel) {
|
|
||||||
this.serializableModel = serializableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String sanitizePath(String p) {
|
private String sanitizePath(String p) {
|
||||||
//prefer replace a ", instead of a fuLL URL encode for readability
|
//prefer replace a ", instead of a fuLL URL encode for readability
|
||||||
return p.replaceAll("\"", "%22");
|
return p.replaceAll("\"", "%22");
|
||||||
|
@ -23,6 +23,8 @@ import com.samskivert.mustache.Mustache;
|
|||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -52,53 +54,55 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
|||||||
protected boolean optionalEmitDefaultValuesFlag = false;
|
protected boolean optionalEmitDefaultValuesFlag = false;
|
||||||
protected boolean conditionalSerialization = false;
|
protected boolean conditionalSerialization = false;
|
||||||
protected boolean optionalProjectFileFlag = true;
|
protected boolean optionalProjectFileFlag = true;
|
||||||
protected boolean optionalMethodArgumentFlag = true;
|
@Setter protected boolean optionalMethodArgumentFlag = true;
|
||||||
protected boolean useDateTimeOffsetFlag = false;
|
protected boolean useDateTimeOffsetFlag = false;
|
||||||
protected boolean useDateTimeForDateFlag = false;
|
protected boolean useDateTimeForDateFlag = false;
|
||||||
protected boolean useCollection = false;
|
protected boolean useCollection = false;
|
||||||
protected boolean returnICollection = false;
|
@Setter protected boolean returnICollection = false;
|
||||||
protected boolean netCoreProjectFileFlag = false;
|
@Setter protected boolean netCoreProjectFileFlag = false;
|
||||||
protected boolean nullReferenceTypesFlag = false;
|
protected boolean nullReferenceTypesFlag = false;
|
||||||
protected boolean useSourceGeneration = false;
|
protected boolean useSourceGeneration = false;
|
||||||
|
|
||||||
protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name();
|
protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name();
|
||||||
|
|
||||||
protected String licenseUrl = "http://localhost";
|
@Setter protected String licenseUrl = "http://localhost";
|
||||||
protected String licenseName = "NoLicense";
|
@Setter protected String licenseName = "NoLicense";
|
||||||
|
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String packageName = "Org.OpenAPITools";
|
@Setter protected String packageName = "Org.OpenAPITools";
|
||||||
protected String packageTitle = "OpenAPI Library";
|
@Setter protected String packageTitle = "OpenAPI Library";
|
||||||
protected String packageProductName = "OpenAPILibrary";
|
@Setter protected String packageProductName = "OpenAPILibrary";
|
||||||
protected String packageDescription = "A library generated from a OpenAPI doc";
|
@Setter protected String packageDescription = "A library generated from a OpenAPI doc";
|
||||||
protected String packageCompany = "OpenAPI";
|
@Setter protected String packageCompany = "OpenAPI";
|
||||||
protected String packageCopyright = "No Copyright";
|
@Setter protected String packageCopyright = "No Copyright";
|
||||||
protected String packageAuthors = "OpenAPI";
|
@Setter protected String packageAuthors = "OpenAPI";
|
||||||
public static final String DATE_FORMAT = "dateFormat";
|
public static final String DATE_FORMAT = "dateFormat";
|
||||||
protected String dateFormat = "yyyy'-'MM'-'dd";
|
@Setter protected String dateFormat = "yyyy'-'MM'-'dd";
|
||||||
public static final String DATETIME_FORMAT = "dateTimeFormat";
|
public static final String DATETIME_FORMAT = "dateTimeFormat";
|
||||||
protected String dateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK";
|
@Setter protected String dateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK";
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
protected String interfacePrefix = "I";
|
protected String interfacePrefix = "I";
|
||||||
protected String enumNameSuffix = "Enum";
|
@Setter protected String enumNameSuffix = "Enum";
|
||||||
protected String enumValueSuffix = "Enum";
|
@Setter protected String enumValueSuffix = "Enum";
|
||||||
|
|
||||||
protected String sourceFolder = "src";
|
@Setter protected String sourceFolder = "src";
|
||||||
protected static final String invalidParameterNamePrefix = "var";
|
protected static final String invalidParameterNamePrefix = "var";
|
||||||
protected static final String invalidPropertyNamePrefix = "Var";
|
protected static final String invalidPropertyNamePrefix = "Var";
|
||||||
protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.PascalCase;
|
@Getter protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.PascalCase;
|
||||||
|
|
||||||
// TODO: Add option for test folder output location. Nice to allow e.g. ./test instead of ./src.
|
// TODO: Add option for test folder output location. Nice to allow e.g. ./test instead of ./src.
|
||||||
// This would require updating relative paths (e.g. path to main project file in test project file)
|
// This would require updating relative paths (e.g. path to main project file in test project file)
|
||||||
protected String testFolder = sourceFolder;
|
@Setter protected String testFolder = sourceFolder;
|
||||||
|
|
||||||
protected Set<String> collectionTypes;
|
protected Set<String> collectionTypes;
|
||||||
protected Set<String> mapTypes;
|
protected Set<String> mapTypes;
|
||||||
|
|
||||||
// true if support nullable type
|
// true if support nullable type
|
||||||
|
@Getter @Setter
|
||||||
protected boolean supportNullable = Boolean.FALSE;
|
protected boolean supportNullable = Boolean.FALSE;
|
||||||
|
|
||||||
protected Boolean zeroBasedEnums = null;
|
@Setter protected Boolean zeroBasedEnums = null;
|
||||||
protected static final String zeroBasedEnumVendorExtension = "x-zero-based-enum";
|
protected static final String zeroBasedEnumVendorExtension = "x-zero-based-enum";
|
||||||
|
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(AbstractCSharpCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(AbstractCSharpCodegen.class);
|
||||||
@ -211,10 +215,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
|||||||
// this.setSortModelPropertiesByRequiredFlag(true);
|
// this.setSortModelPropertiesByRequiredFlag(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReturnICollection(boolean returnICollection) {
|
|
||||||
this.returnICollection = returnICollection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseCollection(boolean useCollection) {
|
public void setUseCollection(boolean useCollection) {
|
||||||
this.useCollection = useCollection;
|
this.useCollection = useCollection;
|
||||||
if (useCollection) {
|
if (useCollection) {
|
||||||
@ -224,14 +224,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
|||||||
this.setTypeMapping();
|
this.setTypeMapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOptionalMethodArgumentFlag(boolean flag) {
|
|
||||||
this.optionalMethodArgumentFlag = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNetCoreProjectFileFlag(boolean flag) {
|
|
||||||
this.netCoreProjectFileFlag = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void useDateTimeOffset(boolean flag) {
|
public void useDateTimeOffset(boolean flag) {
|
||||||
this.useDateTimeOffsetFlag = flag;
|
this.useDateTimeOffsetFlag = flag;
|
||||||
this.setTypeMapping();
|
this.setTypeMapping();
|
||||||
@ -1541,70 +1533,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
|||||||
return toModelName(name) + "Tests";
|
return toModelName(name) + "Tests";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLicenseUrl(String licenseUrl) {
|
|
||||||
this.licenseUrl = licenseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicenseName(String licenseName) {
|
|
||||||
this.licenseName = licenseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageTitle(String packageTitle) {
|
|
||||||
this.packageTitle = packageTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageProductName(String packageProductName) {
|
|
||||||
this.packageProductName = packageProductName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDateFormat(String dateFormat) {
|
|
||||||
this.dateFormat = dateFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDateTimeFormat(String dateTimeFormat) {
|
|
||||||
this.dateTimeFormat = dateTimeFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageDescription(String packageDescription) {
|
|
||||||
this.packageDescription = packageDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageCompany(String packageCompany) {
|
|
||||||
this.packageCompany = packageCompany;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageCopyright(String packageCopyright) {
|
|
||||||
this.packageCopyright = packageCopyright;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageAuthors(String packageAuthors) {
|
|
||||||
this.packageAuthors = packageAuthors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestFolder(String testFolder) {
|
|
||||||
this.testFolder = testFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInterfacePrefix() {
|
|
||||||
return interfacePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setZeroBasedEnums(final Boolean zeroBasedEnums) {
|
|
||||||
this.zeroBasedEnums = zeroBasedEnums;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag) {
|
public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag) {
|
||||||
this.nullReferenceTypesFlag = nullReferenceTypesFlag;
|
this.nullReferenceTypesFlag = nullReferenceTypesFlag;
|
||||||
additionalProperties.put("nullableReferenceTypes", nullReferenceTypesFlag);
|
additionalProperties.put("nullableReferenceTypes", nullReferenceTypesFlag);
|
||||||
@ -1631,30 +1559,6 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen {
|
|||||||
return this.useSourceGeneration;
|
return this.useSourceGeneration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInterfacePrefix(final String interfacePrefix) {
|
|
||||||
this.interfacePrefix = interfacePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnumNameSuffix(final String enumNameSuffix) {
|
|
||||||
this.enumNameSuffix = enumNameSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnumValueSuffix(final String enumValueSuffix) {
|
|
||||||
this.enumValueSuffix = enumValueSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSupportNullable() {
|
|
||||||
return supportNullable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportNullable(final boolean supportNullable) {
|
|
||||||
this.supportNullable = supportNullable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() {
|
|
||||||
return this.enumPropertyNaming;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnumPropertyNaming(final String enumPropertyNamingType) {
|
public void setEnumPropertyNaming(final String enumPropertyNamingType) {
|
||||||
try {
|
try {
|
||||||
this.enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(enumPropertyNamingType);
|
this.enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(enumPropertyNamingType);
|
||||||
|
@ -44,7 +44,6 @@ import java.util.Arrays;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
abstract public class AbstractCppCodegen extends DefaultCodegen implements CodegenConfig {
|
abstract public class AbstractCppCodegen extends DefaultCodegen implements CodegenConfig {
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(AbstractCppCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(AbstractCppCodegen.class);
|
||||||
|
@ -2,11 +2,11 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.ComposedSchema;
|
import io.swagger.v3.oas.models.media.ComposedSchema;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.media.StringSchema;
|
import io.swagger.v3.oas.models.media.StringSchema;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -48,17 +48,17 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
public static final String PUB_PUBLISH_TO = "pubPublishTo";
|
public static final String PUB_PUBLISH_TO = "pubPublishTo";
|
||||||
public static final String USE_ENUM_EXTENSION = "useEnumExtension";
|
public static final String USE_ENUM_EXTENSION = "useEnumExtension";
|
||||||
|
|
||||||
protected String pubLibrary = "openapi.api";
|
@Setter protected String pubLibrary = "openapi.api";
|
||||||
protected String pubName = "openapi";
|
@Setter protected String pubName = "openapi";
|
||||||
protected String pubVersion = "1.0.0";
|
@Setter protected String pubVersion = "1.0.0";
|
||||||
protected String pubDescription = "OpenAPI API client";
|
@Setter protected String pubDescription = "OpenAPI API client";
|
||||||
protected String pubAuthor = "Author";
|
@Setter protected String pubAuthor = "Author";
|
||||||
protected String pubAuthorEmail = "author@homepage";
|
@Setter protected String pubAuthorEmail = "author@homepage";
|
||||||
protected String pubHomepage = "homepage";
|
@Setter protected String pubHomepage = "homepage";
|
||||||
protected String pubRepository = null;
|
@Setter protected String pubRepository = null;
|
||||||
protected String pubPublishTo = null;
|
@Setter protected String pubPublishTo = null;
|
||||||
protected boolean useEnumExtension = false;
|
@Setter protected boolean useEnumExtension = false;
|
||||||
protected String sourceFolder = "src";
|
@Setter protected String sourceFolder = "src";
|
||||||
protected String libPath = "lib" + File.separator;
|
protected String libPath = "lib" + File.separator;
|
||||||
protected String apiDocPath = "doc/";
|
protected String apiDocPath = "doc/";
|
||||||
protected String modelDocPath = "doc/";
|
protected String modelDocPath = "doc/";
|
||||||
@ -764,50 +764,6 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
|
|||||||
return operationId;
|
return operationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPubLibrary(String pubLibrary) {
|
|
||||||
this.pubLibrary = pubLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubName(String pubName) {
|
|
||||||
this.pubName = pubName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubVersion(String pubVersion) {
|
|
||||||
this.pubVersion = pubVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubDescription(String pubDescription) {
|
|
||||||
this.pubDescription = pubDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubAuthor(String pubAuthor) {
|
|
||||||
this.pubAuthor = pubAuthor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubAuthorEmail(String pubAuthorEmail) {
|
|
||||||
this.pubAuthorEmail = pubAuthorEmail;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubHomepage(String pubHomepage) {
|
|
||||||
this.pubHomepage = pubHomepage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubRepository(String pubRepository) {
|
|
||||||
this.pubRepository = pubRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPubPublishTo(String pubPublishTo) {
|
|
||||||
this.pubPublishTo = pubPublishTo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseEnumExtension(boolean useEnumExtension) {
|
|
||||||
this.useEnumExtension = useEnumExtension;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeQuotationMark(String input) {
|
public String escapeQuotationMark(String input) {
|
||||||
// remove " to avoid code injection
|
// remove " to avoid code injection
|
||||||
|
@ -20,7 +20,6 @@ package org.openapitools.codegen.languages;
|
|||||||
import com.google.common.collect.ArrayListMultimap;
|
import com.google.common.collect.ArrayListMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import io.swagger.v3.core.util.Json;
|
import io.swagger.v3.core.util.Json;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
|
@ -20,8 +20,9 @@ import com.google.common.collect.ImmutableMap;
|
|||||||
import com.samskivert.mustache.Mustache.Lambda;
|
import com.samskivert.mustache.Mustache.Lambda;
|
||||||
|
|
||||||
import io.swagger.v3.core.util.Json;
|
import io.swagger.v3.core.util.Json;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -49,33 +50,35 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
|||||||
|
|
||||||
protected boolean useDateTimeOffsetFlag = false;
|
protected boolean useDateTimeOffsetFlag = false;
|
||||||
protected boolean useCollection = false;
|
protected boolean useCollection = false;
|
||||||
protected boolean returnICollection = false;
|
@Setter protected boolean returnICollection = false;
|
||||||
protected boolean netCoreProjectFileFlag = false;
|
@Setter protected boolean netCoreProjectFileFlag = false;
|
||||||
|
|
||||||
protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name();
|
@Getter protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name();
|
||||||
|
|
||||||
protected String licenseUrl = "http://localhost";
|
@Setter protected String licenseUrl = "http://localhost";
|
||||||
protected String licenseName = "NoLicense";
|
@Setter protected String licenseName = "NoLicense";
|
||||||
|
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String packageName = "OpenAPI";
|
protected String packageName = "OpenAPI";
|
||||||
protected String packageTitle = "OpenAPI Library";
|
@Setter protected String packageTitle = "OpenAPI Library";
|
||||||
protected String packageProductName = "OpenAPILibrary";
|
@Setter protected String packageProductName = "OpenAPILibrary";
|
||||||
protected String packageDescription = "A library generated from a OpenAPI doc";
|
@Setter protected String packageDescription = "A library generated from a OpenAPI doc";
|
||||||
protected String packageCompany = "OpenAPI";
|
@Setter protected String packageCompany = "OpenAPI";
|
||||||
protected String packageCopyright = "No Copyright";
|
@Setter protected String packageCopyright = "No Copyright";
|
||||||
protected String packageAuthors = "OpenAPI";
|
@Setter protected String packageAuthors = "OpenAPI";
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
protected String interfacePrefix = "I";
|
protected String interfacePrefix = "I";
|
||||||
|
|
||||||
protected String projectFolder = packageName;
|
protected String projectFolder = packageName;
|
||||||
protected String sourceFolder = projectFolder + File.separator + "src";
|
@Setter protected String sourceFolder = projectFolder + File.separator + "src";
|
||||||
protected String testFolder = projectFolder + ".Tests";
|
protected String testFolder = projectFolder + ".Tests";
|
||||||
|
|
||||||
protected Set<String> collectionTypes;
|
protected Set<String> collectionTypes;
|
||||||
protected Set<String> mapTypes;
|
protected Set<String> mapTypes;
|
||||||
|
|
||||||
// true if nullable types will be supported (as option)
|
// true if nullable types will be supported (as option)
|
||||||
|
@Getter @Setter
|
||||||
protected boolean supportNullable = Boolean.TRUE;
|
protected boolean supportNullable = Boolean.TRUE;
|
||||||
|
|
||||||
protected Set<String> nullableType = new HashSet<>();
|
protected Set<String> nullableType = new HashSet<>();
|
||||||
@ -187,10 +190,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReturnICollection(boolean returnICollection) {
|
|
||||||
this.returnICollection = returnICollection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseCollection(boolean useCollection) {
|
public void setUseCollection(boolean useCollection) {
|
||||||
this.useCollection = useCollection;
|
this.useCollection = useCollection;
|
||||||
if (useCollection) {
|
if (useCollection) {
|
||||||
@ -202,10 +201,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNetCoreProjectFileFlag(boolean flag) {
|
|
||||||
this.netCoreProjectFileFlag = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void useDateTimeOffset(boolean flag) {
|
public void useDateTimeOffset(boolean flag) {
|
||||||
this.useDateTimeOffsetFlag = flag;
|
this.useDateTimeOffsetFlag = flag;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
@ -641,10 +636,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
|||||||
return camelize(sanitizeName(operationId));
|
return camelize(sanitizeName(operationId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModelPropertyNaming() {
|
|
||||||
return this.modelPropertyNaming;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModelPropertyNaming(String naming) {
|
public void setModelPropertyNaming(String naming) {
|
||||||
if ("original".equals(naming) || "camelCase".equals(naming) ||
|
if ("original".equals(naming) || "camelCase".equals(naming) ||
|
||||||
"PascalCase".equals(naming) || "snake_case".equals(naming)) {
|
"PascalCase".equals(naming) || "snake_case".equals(naming)) {
|
||||||
@ -936,14 +927,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
|||||||
return toModelName(name) + "Tests";
|
return toModelName(name) + "Tests";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLicenseUrl(String licenseUrl) {
|
|
||||||
this.licenseUrl = licenseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicenseName(String licenseName) {
|
|
||||||
this.licenseName = licenseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
public void setPackageName(String packageName) {
|
||||||
this.packageName = packageName;
|
this.packageName = packageName;
|
||||||
this.projectFolder = packageName;
|
this.projectFolder = packageName;
|
||||||
@ -951,54 +934,6 @@ public abstract class AbstractFSharpCodegen extends DefaultCodegen implements Co
|
|||||||
this.testFolder = projectFolder + ".Tests";
|
this.testFolder = projectFolder + ".Tests";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageTitle(String packageTitle) {
|
|
||||||
this.packageTitle = packageTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageProductName(String packageProductName) {
|
|
||||||
this.packageProductName = packageProductName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageDescription(String packageDescription) {
|
|
||||||
this.packageDescription = packageDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageCompany(String packageCompany) {
|
|
||||||
this.packageCompany = packageCompany;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageCopyright(String packageCopyright) {
|
|
||||||
this.packageCopyright = packageCopyright;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageAuthors(String packageAuthors) {
|
|
||||||
this.packageAuthors = packageAuthors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInterfacePrefix() {
|
|
||||||
return interfacePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterfacePrefix(final String interfacePrefix) {
|
|
||||||
this.interfacePrefix = interfacePrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSupportNullable() {
|
|
||||||
return supportNullable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportNullable(final boolean supportNullable) {
|
|
||||||
this.supportNullable = supportNullable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toEnumValue(String value, String datatype) {
|
public String toEnumValue(String value, String datatype) {
|
||||||
// C# only supports enums as literals for int, int?, long, long?, byte, and byte?. All else must be treated as strings.
|
// C# only supports enums as literals for int, int?, long, long?, byte, and byte?. All else must be treated as strings.
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -40,18 +40,17 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
|||||||
private final Logger LOGGER = LoggerFactory.getLogger(AbstractGoCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(AbstractGoCodegen.class);
|
||||||
private static final String NUMERIC_ENUM_PREFIX = "_";
|
private static final String NUMERIC_ENUM_PREFIX = "_";
|
||||||
|
|
||||||
protected boolean withGoCodegenComment = false;
|
@Setter protected boolean withGoCodegenComment = false;
|
||||||
protected boolean withAWSV4Signature = false;
|
@Setter protected boolean withAWSV4Signature = false;
|
||||||
protected boolean withXml = false;
|
@Setter protected boolean withXml = false;
|
||||||
protected boolean enumClassPrefix = false;
|
@Setter protected boolean enumClassPrefix = false;
|
||||||
protected boolean structPrefix = false;
|
@Setter protected boolean structPrefix = false;
|
||||||
protected boolean generateInterfaces = false;
|
@Setter protected boolean generateInterfaces = false;
|
||||||
protected boolean withGoMod = false;
|
@Setter protected boolean withGoMod = false;
|
||||||
protected boolean generateMarshalJSON = true;
|
@Setter protected boolean generateMarshalJSON = true;
|
||||||
protected boolean generateUnmarshalJSON = true;
|
@Setter protected boolean generateUnmarshalJSON = true;
|
||||||
|
|
||||||
|
@Setter protected String packageName = "openapi";
|
||||||
protected String packageName = "openapi";
|
|
||||||
protected Set<String> numberTypes;
|
protected Set<String> numberTypes;
|
||||||
|
|
||||||
public AbstractGoCodegen() {
|
public AbstractGoCodegen() {
|
||||||
@ -814,10 +813,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
|||||||
return !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type);
|
return !defaultIncludes.contains(type) && !languageSpecificPrimitives.contains(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeQuotationMark(String input) {
|
public String escapeQuotationMark(String input) {
|
||||||
// remove " to avoid code injection
|
// remove " to avoid code injection
|
||||||
@ -906,42 +901,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWithGoCodegenComment(boolean withGoCodegenComment) {
|
|
||||||
this.withGoCodegenComment = withGoCodegenComment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWithAWSV4Signature(boolean withAWSV4Signature) {
|
|
||||||
this.withAWSV4Signature = withAWSV4Signature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWithXml(boolean withXml) {
|
|
||||||
this.withXml = withXml;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnumClassPrefix(boolean enumClassPrefix) {
|
|
||||||
this.enumClassPrefix = enumClassPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStructPrefix(boolean structPrefix) {
|
|
||||||
this.structPrefix = structPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateInterfaces(boolean generateInterfaces) {
|
|
||||||
this.generateInterfaces = generateInterfaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWithGoMod(boolean withGoMod) {
|
|
||||||
this.withGoMod = withGoMod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateMarshalJSON(boolean generateMarshalJSON) {
|
|
||||||
this.generateMarshalJSON = generateMarshalJSON;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateUnmarshalJSON(boolean generateUnmarshalJSON) {
|
|
||||||
this.generateUnmarshalJSON = generateUnmarshalJSON;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toDefaultValue(Schema schema) {
|
public String toDefaultValue(Schema schema) {
|
||||||
schema = unaliasSchema(schema);
|
schema = unaliasSchema(schema);
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -39,8 +39,8 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C
|
|||||||
private final Logger LOGGER = LoggerFactory.getLogger(AbstractGraphQLCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(AbstractGraphQLCodegen.class);
|
||||||
|
|
||||||
protected String specFolder = "spec";
|
protected String specFolder = "spec";
|
||||||
protected String packageName = "openapi2graphql";
|
@Setter protected String packageName = "openapi2graphql";
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
@ -116,14 +116,6 @@ public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements C
|
|||||||
additionalProperties.put("modelDocPath", modelDocPath);
|
additionalProperties.put("modelDocPath", modelDocPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeReservedWord(String name) {
|
public String escapeReservedWord(String name) {
|
||||||
// Can't start with an underscore, as our fields need to start with an
|
// Can't start with an underscore, as our fields need to start with an
|
||||||
|
@ -31,6 +31,8 @@ import io.swagger.v3.oas.models.parameters.Parameter;
|
|||||||
import io.swagger.v3.oas.models.parameters.RequestBody;
|
import io.swagger.v3.oas.models.parameters.RequestBody;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -96,55 +98,87 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi";
|
public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi";
|
||||||
public static final String GENERATE_CONSTRUCTOR_WITH_ALL_ARGS = "generateConstructorWithAllArgs";
|
public static final String GENERATE_CONSTRUCTOR_WITH_ALL_ARGS = "generateConstructorWithAllArgs";
|
||||||
public static final String GENERATE_BUILDERS = "generateBuilders";
|
public static final String GENERATE_BUILDERS = "generateBuilders";
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
protected String dateLibrary = "java8";
|
protected String dateLibrary = "java8";
|
||||||
protected boolean supportAsync = false;
|
@Setter protected boolean supportAsync = false;
|
||||||
protected boolean withXml = false;
|
@Setter protected boolean withXml = false;
|
||||||
|
@Getter @Setter
|
||||||
protected String invokerPackage = "org.openapitools";
|
protected String invokerPackage = "org.openapitools";
|
||||||
|
@Getter @Setter
|
||||||
protected String groupId = "org.openapitools";
|
protected String groupId = "org.openapitools";
|
||||||
|
@Getter @Setter
|
||||||
protected String artifactId = "openapi-java";
|
protected String artifactId = "openapi-java";
|
||||||
|
@Getter @Setter
|
||||||
protected String artifactVersion = null;
|
protected String artifactVersion = null;
|
||||||
|
@Getter @Setter
|
||||||
protected String artifactUrl = "https://github.com/openapitools/openapi-generator";
|
protected String artifactUrl = "https://github.com/openapitools/openapi-generator";
|
||||||
|
@Getter @Setter
|
||||||
protected String artifactDescription = "OpenAPI Java";
|
protected String artifactDescription = "OpenAPI Java";
|
||||||
|
@Getter @Setter
|
||||||
protected String developerName = "OpenAPI-Generator Contributors";
|
protected String developerName = "OpenAPI-Generator Contributors";
|
||||||
|
@Getter @Setter
|
||||||
protected String developerEmail = "team@openapitools.org";
|
protected String developerEmail = "team@openapitools.org";
|
||||||
|
@Getter @Setter
|
||||||
protected String developerOrganization = "OpenAPITools.org";
|
protected String developerOrganization = "OpenAPITools.org";
|
||||||
|
@Getter @Setter
|
||||||
protected String developerOrganizationUrl = "http://openapitools.org";
|
protected String developerOrganizationUrl = "http://openapitools.org";
|
||||||
|
@Getter @Setter
|
||||||
protected String scmConnection = "scm:git:git@github.com:openapitools/openapi-generator.git";
|
protected String scmConnection = "scm:git:git@github.com:openapitools/openapi-generator.git";
|
||||||
|
@Getter @Setter
|
||||||
protected String scmDeveloperConnection = "scm:git:git@github.com:openapitools/openapi-generator.git";
|
protected String scmDeveloperConnection = "scm:git:git@github.com:openapitools/openapi-generator.git";
|
||||||
|
@Getter @Setter
|
||||||
protected String scmUrl = "https://github.com/openapitools/openapi-generator";
|
protected String scmUrl = "https://github.com/openapitools/openapi-generator";
|
||||||
|
@Getter @Setter
|
||||||
protected String licenseName = "Unlicense";
|
protected String licenseName = "Unlicense";
|
||||||
|
@Getter @Setter
|
||||||
protected String licenseUrl = "http://unlicense.org";
|
protected String licenseUrl = "http://unlicense.org";
|
||||||
protected String projectFolder = "src/main";
|
protected String projectFolder = "src/main";
|
||||||
protected String projectTestFolder = "src/test";
|
protected String projectTestFolder = "src/test";
|
||||||
// this must not be OS-specific
|
// this must not be OS-specific
|
||||||
|
@Getter @Setter
|
||||||
protected String sourceFolder = projectFolder + "/java";
|
protected String sourceFolder = projectFolder + "/java";
|
||||||
|
@Getter @Setter
|
||||||
protected String testFolder = projectTestFolder + "/java";
|
protected String testFolder = projectTestFolder + "/java";
|
||||||
protected boolean discriminatorCaseSensitive = true; // True if the discriminator value lookup should be case-sensitive.
|
/**
|
||||||
|
* -- SETTER --
|
||||||
|
* Set whether discriminator value lookup is case-sensitive or not.
|
||||||
|
*
|
||||||
|
* @param discriminatorCaseSensitive true if the discriminator value lookup should be case-sensitive.
|
||||||
|
*/
|
||||||
|
@Setter protected boolean discriminatorCaseSensitive = true;
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean serializableModel = false;
|
protected Boolean serializableModel = false;
|
||||||
protected boolean serializeBigDecimalAsString = false;
|
@Setter protected boolean serializeBigDecimalAsString = false;
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
protected boolean disableHtmlEscaping = false;
|
@Setter protected boolean disableHtmlEscaping = false;
|
||||||
|
@Getter @Setter
|
||||||
protected String booleanGetterPrefix = "get";
|
protected String booleanGetterPrefix = "get";
|
||||||
protected boolean ignoreAnyOfInEnum = false;
|
@Setter protected boolean ignoreAnyOfInEnum = false;
|
||||||
protected String parentGroupId = "";
|
@Setter protected String parentGroupId = "";
|
||||||
protected String parentArtifactId = "";
|
@Setter protected String parentArtifactId = "";
|
||||||
protected String parentVersion = "";
|
@Setter protected String parentVersion = "";
|
||||||
protected boolean parentOverridden = false;
|
@Setter protected boolean parentOverridden = false;
|
||||||
|
@Getter @Setter
|
||||||
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
|
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
|
||||||
protected Map<String, Boolean> lombokAnnotations = null;
|
protected Map<String, Boolean> lombokAnnotations = null;
|
||||||
|
@Getter @Setter
|
||||||
protected List<String> additionalOneOfTypeAnnotations = new LinkedList<>();
|
protected List<String> additionalOneOfTypeAnnotations = new LinkedList<>();
|
||||||
protected List<String> additionalEnumTypeAnnotations = new LinkedList<>();
|
@Setter protected List<String> additionalEnumTypeAnnotations = new LinkedList<>();
|
||||||
|
@Getter @Setter
|
||||||
protected boolean openApiNullable = true;
|
protected boolean openApiNullable = true;
|
||||||
protected String outputTestFolder = "";
|
@Setter protected String outputTestFolder = "";
|
||||||
protected DocumentationProvider documentationProvider;
|
protected DocumentationProvider documentationProvider;
|
||||||
protected AnnotationLibrary annotationLibrary;
|
protected AnnotationLibrary annotationLibrary;
|
||||||
protected boolean implicitHeaders = false;
|
@Setter protected boolean implicitHeaders = false;
|
||||||
protected String implicitHeadersRegex = null;
|
@Setter protected String implicitHeadersRegex = null;
|
||||||
protected boolean camelCaseDollarSign = false;
|
@Setter protected boolean camelCaseDollarSign = false;
|
||||||
protected boolean useJakartaEe = false;
|
@Setter protected boolean useJakartaEe = false;
|
||||||
protected boolean containerDefaultToNull = false;
|
@Setter protected boolean containerDefaultToNull = false;
|
||||||
|
@Getter @Setter
|
||||||
protected boolean generateConstructorWithAllArgs = false;
|
protected boolean generateConstructorWithAllArgs = false;
|
||||||
|
@Getter @Setter
|
||||||
protected boolean generateBuilder = false;
|
protected boolean generateBuilder = false;
|
||||||
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
||||||
|
|
||||||
@ -692,22 +726,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGenerateConstructorWithAllArgs(boolean aValue) {
|
|
||||||
this.generateConstructorWithAllArgs = aValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isGenerateConstructorWithAllArgs() {
|
|
||||||
return generateConstructorWithAllArgs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateBuilder(boolean aValue) {
|
|
||||||
this.generateBuilder = aValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isGenerateBuilder() {
|
|
||||||
return generateBuilder;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Analyse and post process all Models.
|
* Analyse and post process all Models.
|
||||||
* @param objs the models map.
|
* @param objs the models map.
|
||||||
@ -1241,14 +1259,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
return validations;
|
return validations;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAlias(String name) {
|
|
||||||
if (typeAliases != null && typeAliases.containsKey(name)) {
|
|
||||||
return typeAliases.get(name);
|
|
||||||
}
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the default value of array property
|
* Return the default value of array property
|
||||||
* <p>
|
* <p>
|
||||||
@ -1838,6 +1848,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void postProcessResponseWithProperty(CodegenResponse response, CodegenProperty property) {
|
public void postProcessResponseWithProperty(CodegenResponse response, CodegenProperty property) {
|
||||||
if (response == null || property == null || response.dataType == null || property.dataType == null) {
|
if (response == null || property == null || response.dataType == null || property.dataType == null) {
|
||||||
return;
|
return;
|
||||||
@ -2140,208 +2151,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
return packageName;
|
return packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInvokerPackage() {
|
|
||||||
return invokerPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInvokerPackage(String invokerPackage) {
|
|
||||||
this.invokerPackage = invokerPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGroupId() {
|
|
||||||
return groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupId(String groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getArtifactId() {
|
|
||||||
return artifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactId(String artifactId) {
|
|
||||||
this.artifactId = artifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getArtifactVersion() {
|
|
||||||
return artifactVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactVersion(String artifactVersion) {
|
|
||||||
this.artifactVersion = artifactVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getArtifactUrl() {
|
|
||||||
return artifactUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactUrl(String artifactUrl) {
|
|
||||||
this.artifactUrl = artifactUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getArtifactDescription() {
|
|
||||||
return artifactDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactDescription(String artifactDescription) {
|
|
||||||
this.artifactDescription = artifactDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getScmConnection() {
|
|
||||||
return scmConnection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setScmConnection(String scmConnection) {
|
|
||||||
this.scmConnection = scmConnection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getScmDeveloperConnection() {
|
|
||||||
return scmDeveloperConnection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setScmDeveloperConnection(String scmDeveloperConnection) {
|
|
||||||
this.scmDeveloperConnection = scmDeveloperConnection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getScmUrl() {
|
|
||||||
return scmUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setScmUrl(String scmUrl) {
|
|
||||||
this.scmUrl = scmUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDeveloperName() {
|
|
||||||
return developerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeveloperName(String developerName) {
|
|
||||||
this.developerName = developerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDeveloperEmail() {
|
|
||||||
return developerEmail;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeveloperEmail(String developerEmail) {
|
|
||||||
this.developerEmail = developerEmail;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDeveloperOrganization() {
|
|
||||||
return developerOrganization;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeveloperOrganization(String developerOrganization) {
|
|
||||||
this.developerOrganization = developerOrganization;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDeveloperOrganizationUrl() {
|
|
||||||
return developerOrganizationUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeveloperOrganizationUrl(String developerOrganizationUrl) {
|
|
||||||
this.developerOrganizationUrl = developerOrganizationUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLicenseName() {
|
|
||||||
return licenseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicenseName(String licenseName) {
|
|
||||||
this.licenseName = licenseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLicenseUrl() {
|
|
||||||
return licenseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicenseUrl(String licenseUrl) {
|
|
||||||
this.licenseUrl = licenseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSourceFolder() {
|
|
||||||
return sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTestFolder() {
|
|
||||||
return testFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestFolder(String testFolder) {
|
|
||||||
this.testFolder = testFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSerializeBigDecimalAsString(boolean s) {
|
|
||||||
this.serializeBigDecimalAsString = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSerializableModel() {
|
|
||||||
return serializableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSerializableModel(Boolean serializableModel) {
|
|
||||||
this.serializableModel = serializableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String sanitizePath(String p) {
|
private String sanitizePath(String p) {
|
||||||
//prefer replace a ", instead of a fuLL URL encode for readability
|
//prefer replace a ", instead of a fuLL URL encode for readability
|
||||||
return p.replaceAll("\"", "%22");
|
return p.replaceAll("\"", "%22");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set whether discriminator value lookup is case-sensitive or not.
|
|
||||||
*
|
|
||||||
* @param discriminatorCaseSensitive true if the discriminator value lookup should be case sensitive.
|
|
||||||
*/
|
|
||||||
public void setDiscriminatorCaseSensitive(boolean discriminatorCaseSensitive) {
|
|
||||||
this.discriminatorCaseSensitive = discriminatorCaseSensitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWithXml(boolean withXml) {
|
|
||||||
this.withXml = withXml;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDateLibrary() {
|
|
||||||
return dateLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDateLibrary(String library) {
|
|
||||||
this.dateLibrary = library;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportAsync(boolean enabled) {
|
|
||||||
this.supportAsync = enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDisableHtmlEscaping(boolean disabled) {
|
|
||||||
this.disableHtmlEscaping = disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBooleanGetterPrefix() {
|
|
||||||
return booleanGetterPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBooleanGetterPrefix(String booleanGetterPrefix) {
|
|
||||||
this.booleanGetterPrefix = booleanGetterPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIgnoreAnyOfInEnum(boolean ignoreAnyOfInEnum) {
|
|
||||||
this.ignoreAnyOfInEnum = ignoreAnyOfInEnum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOpenApiNullable() {
|
|
||||||
return openApiNullable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpenApiNullable(final boolean openApiNullable) {
|
|
||||||
this.openApiNullable = openApiNullable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOutputDir(String dir) {
|
public void setOutputDir(String dir) {
|
||||||
super.setOutputDir(dir);
|
super.setOutputDir(dir);
|
||||||
@ -2357,10 +2171,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
return outputTestFolder;
|
return outputTestFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOutputTestFolder(String outputTestFolder) {
|
|
||||||
this.outputTestFolder = outputTestFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentationProvider getDocumentationProvider() {
|
public DocumentationProvider getDocumentationProvider() {
|
||||||
return documentationProvider;
|
return documentationProvider;
|
||||||
@ -2381,26 +2191,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
this.annotationLibrary = annotationLibrary;
|
this.annotationLibrary = annotationLibrary;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImplicitHeaders(boolean implicitHeaders) {
|
|
||||||
this.implicitHeaders = implicitHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImplicitHeadersRegex(String implicitHeadersRegex) {
|
|
||||||
this.implicitHeadersRegex = implicitHeadersRegex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCamelCaseDollarSign(boolean camelCaseDollarSign) {
|
|
||||||
this.camelCaseDollarSign = camelCaseDollarSign;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseJakartaEe(boolean useJakartaEe) {
|
|
||||||
this.useJakartaEe = useJakartaEe;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContainerDefaultToNull(boolean containerDefaultToNull) {
|
|
||||||
this.containerDefaultToNull = containerDefaultToNull;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeQuotationMark(String input) {
|
public String escapeQuotationMark(String input) {
|
||||||
// remove " to avoid code injection
|
// remove " to avoid code injection
|
||||||
@ -2527,42 +2317,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParentGroupId(final String parentGroupId) {
|
|
||||||
this.parentGroupId = parentGroupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentArtifactId(final String parentArtifactId) {
|
|
||||||
this.parentArtifactId = parentArtifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentVersion(final String parentVersion) {
|
|
||||||
this.parentVersion = parentVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentOverridden(final boolean parentOverridden) {
|
|
||||||
this.parentOverridden = parentOverridden;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getAdditionalModelTypeAnnotations() {
|
|
||||||
return additionalModelTypeAnnotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAdditionalModelTypeAnnotations(final List<String> additionalModelTypeAnnotations) {
|
|
||||||
this.additionalModelTypeAnnotations = additionalModelTypeAnnotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getAdditionalOneOfTypeAnnotations() {
|
|
||||||
return additionalOneOfTypeAnnotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAdditionalOneOfTypeAnnotations(final List<String> additionalOneOfTypeAnnotations) {
|
|
||||||
this.additionalOneOfTypeAnnotations = additionalOneOfTypeAnnotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAdditionalEnumTypeAnnotations(final List<String> additionalEnumTypeAnnotations) {
|
|
||||||
this.additionalEnumTypeAnnotations = additionalEnumTypeAnnotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
||||||
if (!supportsAdditionalPropertiesWithComposedSchema) {
|
if (!supportsAdditionalPropertiesWithComposedSchema) {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.ClientModificationFeature;
|
import org.openapitools.codegen.meta.features.ClientModificationFeature;
|
||||||
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
import org.openapitools.codegen.meta.features.DocumentationFeature;
|
||||||
@ -32,7 +33,6 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
@ -63,9 +63,9 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen {
|
|||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
protected String packageName;
|
@Setter protected String packageName;
|
||||||
protected Boolean exportModels;
|
@Setter protected Boolean exportModels;
|
||||||
protected Boolean exportOperations;
|
@Setter protected Boolean exportOperations;
|
||||||
|
|
||||||
protected final DateTimeFormatter OFFSET_DATE_TIME_FORMAT = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
protected final DateTimeFormatter OFFSET_DATE_TIME_FORMAT = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||||
protected final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT);
|
protected final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT);
|
||||||
@ -147,18 +147,6 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen {
|
|||||||
return GeneratorLanguage.JULIA;
|
return GeneratorLanguage.JULIA;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExportModels(Boolean exportModels) {
|
|
||||||
this.exportModels = exportModels;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExportOperations(Boolean exportOperations) {
|
|
||||||
this.exportOperations = exportOperations;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static String dropDots(String str) {
|
protected static String dropDots(String str) {
|
||||||
return str.replaceAll("\\.", "_");
|
return str.replaceAll("\\.", "_");
|
||||||
}
|
}
|
||||||
@ -440,6 +428,7 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen {
|
|||||||
* @param input String to be cleaned up
|
* @param input String to be cleaned up
|
||||||
* @return string with quotation mark removed or escaped
|
* @return string with quotation mark removed or escaped
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String escapeQuotationMark(String input) {
|
public String escapeQuotationMark(String input) {
|
||||||
return input.replace("\"", "\\\"");
|
return input.replace("\"", "\\\"");
|
||||||
}
|
}
|
||||||
@ -500,6 +489,7 @@ public abstract class AbstractJuliaCodegen extends DefaultCodegen {
|
|||||||
* @param operationId operation ID
|
* @param operationId operation ID
|
||||||
* @return the sanitized method name
|
* @return the sanitized method name
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@SuppressWarnings("static-method")
|
@SuppressWarnings("static-method")
|
||||||
public String toOperationId(String operationId) {
|
public String toOperationId(String operationId) {
|
||||||
CamelizeOption camelizeOption = CamelizeOption.UPPERCASE_FIRST_CHAR;
|
CamelizeOption camelizeOption = CamelizeOption.UPPERCASE_FIRST_CHAR;
|
||||||
|
@ -20,9 +20,10 @@ package org.openapitools.codegen.languages;
|
|||||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.media.StringSchema;
|
import io.swagger.v3.oas.models.media.StringSchema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -55,32 +56,34 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
|
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class);
|
||||||
|
|
||||||
protected String artifactId;
|
@Setter protected String artifactId;
|
||||||
protected String artifactVersion = "1.0.0";
|
@Setter protected String artifactVersion = "1.0.0";
|
||||||
protected String groupId = "org.openapitools";
|
@Setter protected String groupId = "org.openapitools";
|
||||||
protected String packageName = "org.openapitools";
|
@Setter protected String packageName = "org.openapitools";
|
||||||
protected String apiSuffix = "Api";
|
@Setter protected String apiSuffix = "Api";
|
||||||
|
|
||||||
protected String sourceFolder = "src/main/kotlin";
|
@Setter protected String sourceFolder = "src/main/kotlin";
|
||||||
protected String testFolder = "src/test/kotlin";
|
@Setter protected String testFolder = "src/test/kotlin";
|
||||||
protected String resourcesFolder = "src/main/resources";
|
protected String resourcesFolder = "src/main/resources";
|
||||||
|
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
protected boolean parcelizeModels = false;
|
protected boolean parcelizeModels = false;
|
||||||
|
@Getter @Setter
|
||||||
protected boolean serializableModel = false;
|
protected boolean serializableModel = false;
|
||||||
|
|
||||||
protected boolean useJakartaEe = false;
|
@Setter protected boolean useJakartaEe = false;
|
||||||
|
|
||||||
protected boolean nonPublicApi = false;
|
@Setter protected boolean nonPublicApi = false;
|
||||||
|
|
||||||
protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.original;
|
@Getter protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.original;
|
||||||
|
|
||||||
// model classes cannot use the same property names defined in HashMap
|
// model classes cannot use the same property names defined in HashMap
|
||||||
// ref: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-hash-map/
|
// ref: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-hash-map/
|
||||||
protected Set<String> propertyAdditionalKeywords = new HashSet<>(Arrays.asList("entries", "keys", "size", "values"));
|
protected Set<String> propertyAdditionalKeywords = new HashSet<>(Arrays.asList("entries", "keys", "size", "values"));
|
||||||
|
|
||||||
private final Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
private final Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
||||||
|
@Getter @Setter
|
||||||
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
|
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
|
||||||
|
|
||||||
public AbstractKotlinCodegen() {
|
public AbstractKotlinCodegen() {
|
||||||
@ -304,10 +307,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
return input.replace("*/", "*_/").replace("/*", "/_*");
|
return input.replace("*/", "*_/").replace("/*", "/_*");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() {
|
|
||||||
return this.enumPropertyNaming;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the naming convention for Kotlin enum properties
|
* Sets the naming convention for Kotlin enum properties
|
||||||
@ -537,34 +536,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
return Boolean.TRUE.equals(additionalProperties.get(MODEL_MUTABLE));
|
return Boolean.TRUE.equals(additionalProperties.get(MODEL_MUTABLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setArtifactId(String artifactId) {
|
|
||||||
this.artifactId = artifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactVersion(String artifactVersion) {
|
|
||||||
this.artifactVersion = artifactVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupId(String groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApiSuffix(String apiSuffix) {
|
|
||||||
this.apiSuffix = apiSuffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestFolder(String testFolder) {
|
|
||||||
this.testFolder = testFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getParcelizeModels() {
|
public Boolean getParcelizeModels() {
|
||||||
return parcelizeModels;
|
return parcelizeModels;
|
||||||
}
|
}
|
||||||
@ -573,26 +544,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
this.parcelizeModels = parcelizeModels;
|
this.parcelizeModels = parcelizeModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSerializableModel() {
|
|
||||||
return serializableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSerializableModel(boolean serializableModel) {
|
|
||||||
this.serializableModel = serializableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseJakartaEe(boolean useJakartaEe) {
|
|
||||||
this.useJakartaEe = useJakartaEe;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean nonPublicApi() {
|
public boolean nonPublicApi() {
|
||||||
return nonPublicApi;
|
return nonPublicApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNonPublicApi(boolean nonPublicApi) {
|
|
||||||
this.nonPublicApi = nonPublicApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the sanitized variable name for enum
|
* Return the sanitized variable name for enum
|
||||||
*
|
*
|
||||||
@ -1166,14 +1121,6 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
setAddProps(schema, m);
|
setAddProps(schema, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAdditionalModelTypeAnnotations() {
|
|
||||||
return additionalModelTypeAnnotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAdditionalModelTypeAnnotations(final List<String> additionalModelTypeAnnotations) {
|
|
||||||
this.additionalModelTypeAnnotations = additionalModelTypeAnnotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ImmutableMap.Builder<String, Mustache.Lambda> addMustacheLambdas() {
|
protected ImmutableMap.Builder<String, Mustache.Lambda> addMustacheLambdas() {
|
||||||
return super.addMustacheLambdas()
|
return super.addMustacheLambdas()
|
||||||
|
@ -16,9 +16,10 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.media.StringSchema;
|
import io.swagger.v3.oas.models.media.StringSchema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -48,15 +49,17 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
|
|||||||
public static final String VARIABLE_NAMING_CONVENTION = "variableNamingConvention";
|
public static final String VARIABLE_NAMING_CONVENTION = "variableNamingConvention";
|
||||||
public static final String PACKAGE_NAME = "packageName";
|
public static final String PACKAGE_NAME = "packageName";
|
||||||
public static final String SRC_BASE_PATH = "srcBasePath";
|
public static final String SRC_BASE_PATH = "srcBasePath";
|
||||||
|
@Getter @Setter
|
||||||
protected String invokerPackage = "php";
|
protected String invokerPackage = "php";
|
||||||
|
@Getter @Setter
|
||||||
protected String packageName = "php-base";
|
protected String packageName = "php-base";
|
||||||
protected String artifactVersion = null;
|
@Setter protected String artifactVersion = null;
|
||||||
protected String artifactUrl = "https://openapi-generator.tech";
|
@Setter protected String artifactUrl = "https://openapi-generator.tech";
|
||||||
protected String licenseName = "unlicense";
|
@Setter protected String licenseName = "unlicense";
|
||||||
protected String developerOrganization = "OpenAPI";
|
@Setter protected String developerOrganization = "OpenAPI";
|
||||||
protected String developerOrganizationUrl = "https://openapi-generator.tech";
|
@Setter protected String developerOrganizationUrl = "https://openapi-generator.tech";
|
||||||
protected String srcBasePath = "lib";
|
@Setter protected String srcBasePath = "lib";
|
||||||
protected String testBasePath = "test";
|
@Setter protected String testBasePath = "test";
|
||||||
protected String docsBasePath = "docs";
|
protected String docsBasePath = "docs";
|
||||||
protected String apiDirName = "Api";
|
protected String apiDirName = "Api";
|
||||||
protected String modelDirName = "Model";
|
protected String modelDirName = "Model";
|
||||||
@ -282,10 +285,6 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
|
|||||||
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
|
supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackageName() {
|
|
||||||
return packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toSrcPath(final String packageName, final String basePath) {
|
public String toSrcPath(final String packageName, final String basePath) {
|
||||||
String modifiedPackageName = packageName.replace(invokerPackage, "");
|
String modifiedPackageName = packageName.replace(invokerPackage, "");
|
||||||
String modifiedBasePath = basePath;
|
String modifiedBasePath = basePath;
|
||||||
@ -417,46 +416,6 @@ public abstract class AbstractPhpCodegen extends DefaultCodegen implements Codeg
|
|||||||
return toModelName(type);
|
return toModelName(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInvokerPackage() {
|
|
||||||
return invokerPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInvokerPackage(String invokerPackage) {
|
|
||||||
this.invokerPackage = invokerPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactVersion(String artifactVersion) {
|
|
||||||
this.artifactVersion = artifactVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactUrl(String artifactUrl) {
|
|
||||||
this.artifactUrl = artifactUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLicenseName(String licenseName) {
|
|
||||||
this.licenseName = licenseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeveloperOrganization(String developerOrganization) {
|
|
||||||
this.developerOrganization = developerOrganization;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeveloperOrganizationUrl(String developerOrganizationUrl) {
|
|
||||||
this.developerOrganizationUrl = developerOrganizationUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSrcBasePath(String srcBasePath) {
|
|
||||||
this.srcBasePath = srcBasePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestBasePath(String testBasePath) {
|
|
||||||
this.testBasePath = testBasePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParameterNamingConvention(String variableNamingConvention) {
|
public void setParameterNamingConvention(String variableNamingConvention) {
|
||||||
this.variableNamingConvention = variableNamingConvention;
|
this.variableNamingConvention = variableNamingConvention;
|
||||||
}
|
}
|
||||||
|
@ -41,11 +41,11 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.CodegenConfig;
|
import org.openapitools.codegen.CodegenConfig;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenDiscriminator;
|
|
||||||
import org.openapitools.codegen.CodegenMediaType;
|
import org.openapitools.codegen.CodegenMediaType;
|
||||||
import org.openapitools.codegen.CodegenModel;
|
import org.openapitools.codegen.CodegenModel;
|
||||||
import org.openapitools.codegen.CodegenOperation;
|
import org.openapitools.codegen.CodegenOperation;
|
||||||
@ -66,7 +66,6 @@ import org.slf4j.LoggerFactory;
|
|||||||
import com.github.curiousoddman.rgxgen.RgxGen;
|
import com.github.curiousoddman.rgxgen.RgxGen;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.examples.Example;
|
import io.swagger.v3.oas.models.examples.Example;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||||
|
|
||||||
@ -80,8 +79,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
|||||||
public static final String MAP_NUMBER_TO = "mapNumberTo";
|
public static final String MAP_NUMBER_TO = "mapNumberTo";
|
||||||
|
|
||||||
protected String packageName = "openapi_client";
|
protected String packageName = "openapi_client";
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String projectName; // for setup.py, e.g. petstore-api
|
@Setter protected String projectName; // for setup.py, e.g. petstore-api
|
||||||
protected boolean hasModelsToImport = Boolean.FALSE;
|
protected boolean hasModelsToImport = Boolean.FALSE;
|
||||||
protected String mapNumberTo = "Union[StrictFloat, StrictInt]";
|
protected String mapNumberTo = "Union[StrictFloat, StrictInt]";
|
||||||
protected Map<Character, String> regexModifiers;
|
protected Map<Character, String> regexModifiers;
|
||||||
@ -679,14 +678,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
|||||||
additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName);
|
additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProjectName(String projectName) {
|
|
||||||
this.projectName = projectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTypeDeclaration(Schema p) {
|
public String getTypeDeclaration(Schema p) {
|
||||||
p = ModelUtils.unaliasSchema(openAPI, p);
|
p = ModelUtils.unaliasSchema(openAPI, p);
|
||||||
|
@ -55,7 +55,6 @@ import io.swagger.v3.oas.models.OpenAPI;
|
|||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.PathItem;
|
import io.swagger.v3.oas.models.PathItem;
|
||||||
import io.swagger.v3.oas.models.PathItem.HttpMethod;
|
import io.swagger.v3.oas.models.PathItem.HttpMethod;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||||
import io.swagger.v3.oas.models.parameters.RequestBody;
|
import io.swagger.v3.oas.models.parameters.RequestBody;
|
||||||
@ -737,6 +736,7 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
|||||||
* does not support this in as natural a way so it needs to convert it. See
|
* does not support this in as natural a way so it needs to convert it. See
|
||||||
* https://docs.python.org/2/howto/regex.html#compilation-flags for details.
|
* https://docs.python.org/2/howto/regex.html#compilation-flags for details.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void postProcessPattern(String pattern, Map<String, Object> vendorExtensions) {
|
public void postProcessPattern(String pattern, Map<String, Object> vendorExtensions) {
|
||||||
if (pattern != null) {
|
if (pattern != null) {
|
||||||
int i = pattern.lastIndexOf('/');
|
int i = pattern.lastIndexOf('/');
|
||||||
|
@ -18,9 +18,9 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.github.curiousoddman.rgxgen.RgxGen;
|
import com.github.curiousoddman.rgxgen.RgxGen;
|
||||||
import io.swagger.v3.oas.models.examples.Example;
|
import io.swagger.v3.oas.models.examples.Example;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -48,8 +48,8 @@ public abstract class AbstractPythonPydanticV1Codegen extends DefaultCodegen imp
|
|||||||
public static final String MAP_NUMBER_TO = "mapNumberTo";
|
public static final String MAP_NUMBER_TO = "mapNumberTo";
|
||||||
|
|
||||||
protected String packageName = "openapi_client";
|
protected String packageName = "openapi_client";
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String projectName; // for setup.py, e.g. petstore-api
|
@Setter protected String projectName; // for setup.py, e.g. petstore-api
|
||||||
protected boolean hasModelsToImport = Boolean.FALSE;
|
protected boolean hasModelsToImport = Boolean.FALSE;
|
||||||
protected String mapNumberTo = "Union[StrictFloat, StrictInt]";
|
protected String mapNumberTo = "Union[StrictFloat, StrictInt]";
|
||||||
protected Map<Character, String> regexModifiers;
|
protected Map<Character, String> regexModifiers;
|
||||||
@ -642,14 +642,6 @@ public abstract class AbstractPythonPydanticV1Codegen extends DefaultCodegen imp
|
|||||||
additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName);
|
additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProjectName(String projectName) {
|
|
||||||
this.projectName = projectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTypeDeclaration(Schema p) {
|
public String getTypeDeclaration(Schema p) {
|
||||||
p = ModelUtils.unaliasSchema(openAPI, p);
|
p = ModelUtils.unaliasSchema(openAPI, p);
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -2,7 +2,6 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.FileSchema;
|
import io.swagger.v3.oas.models.media.FileSchema;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -148,8 +147,6 @@ public abstract class AbstractRustCodegen extends DefaultCodegen implements Code
|
|||||||
|
|
||||||
public enum CasingType {CAMEL_CASE, SNAKE_CASE}
|
public enum CasingType {CAMEL_CASE, SNAKE_CASE}
|
||||||
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General purpose sanitizing function for Rust identifiers (fields, variables, structs, parameters, etc.).<br>
|
* General purpose sanitizing function for Rust identifiers (fields, variables, structs, parameters, etc.).<br>
|
||||||
* Rules for Rust are fairly simple:
|
* Rules for Rust are fairly simple:
|
||||||
|
@ -20,10 +20,11 @@ package org.openapitools.codegen.languages;
|
|||||||
import com.samskivert.mustache.Escapers;
|
import com.samskivert.mustache.Escapers;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.media.StringSchema;
|
import io.swagger.v3.oas.models.media.StringSchema;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -48,8 +49,9 @@ import static org.openapitools.codegen.utils.StringUtils.underscore;
|
|||||||
public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(AbstractScalaCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(AbstractScalaCodegen.class);
|
||||||
|
|
||||||
protected String modelPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase.name();
|
@Getter protected String modelPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase.name();
|
||||||
protected String invokerPackage = "org.openapitools.client";
|
@Setter protected String invokerPackage = "org.openapitools.client";
|
||||||
|
@Getter @Setter
|
||||||
protected String sourceFolder = "src/main/scala";
|
protected String sourceFolder = "src/main/scala";
|
||||||
protected String appName = "OpenAPI Sample";
|
protected String appName = "OpenAPI Sample";
|
||||||
protected String appDescription = "A sample openapi server";
|
protected String appDescription = "A sample openapi server";
|
||||||
@ -59,7 +61,7 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
|||||||
protected String licenseUrl = "http://apache.org/licenses/LICENSE-2.0.html";
|
protected String licenseUrl = "http://apache.org/licenses/LICENSE-2.0.html";
|
||||||
protected String apiVersion = "1.0";
|
protected String apiVersion = "1.0";
|
||||||
protected boolean stripPackageName = true;
|
protected boolean stripPackageName = true;
|
||||||
protected String dateLibrary = DateLibraries.java8.name();
|
@Getter protected String dateLibrary = DateLibraries.java8.name();
|
||||||
|
|
||||||
protected enum DateLibraries {
|
protected enum DateLibraries {
|
||||||
java8("Java 8 native JSR310 (preferred for JDK 1.8+)"),
|
java8("Java 8 native JSR310 (preferred for JDK 1.8+)"),
|
||||||
@ -255,10 +257,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
|||||||
throw new IllegalArgumentException("Invalid dateLibrary. Must be 'java8' or 'joda'");
|
throw new IllegalArgumentException("Invalid dateLibrary. Must be 'java8' or 'joda'");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDateLibrary() {
|
|
||||||
return this.dateLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModelPropertyNaming(String naming) {
|
public void setModelPropertyNaming(String naming) {
|
||||||
try {
|
try {
|
||||||
this.modelPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(naming).name();
|
this.modelPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.valueOf(naming).name();
|
||||||
@ -269,10 +267,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModelPropertyNaming() {
|
|
||||||
return this.modelPropertyNaming;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toVarName(String name) {
|
public String toVarName(String name) {
|
||||||
@ -316,14 +310,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSourceFolder() {
|
|
||||||
return sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeReservedWord(String name) {
|
public String escapeReservedWord(String name) {
|
||||||
if (this.reservedWordsMappings().containsKey(name)) {
|
if (this.reservedWordsMappings().containsKey(name)) {
|
||||||
@ -614,10 +600,6 @@ public abstract class AbstractScalaCodegen extends DefaultCodegen {
|
|||||||
return operationId;
|
return operationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInvokerPackage(String invokerPackage) {
|
|
||||||
this.invokerPackage = invokerPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GeneratorLanguage generatorLanguage() {
|
public GeneratorLanguage generatorLanguage() {
|
||||||
return GeneratorLanguage.SCALA;
|
return GeneratorLanguage.SCALA;
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.ComposedSchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
@ -240,14 +240,18 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
@SuppressWarnings("squid:S5164")
|
@SuppressWarnings("squid:S5164")
|
||||||
protected static final ThreadLocal<SimpleDateFormat> SNAPSHOT_SUFFIX_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT));
|
protected static final ThreadLocal<SimpleDateFormat> SNAPSHOT_SUFFIX_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT));
|
||||||
|
|
||||||
protected MODEL_PROPERTY_NAMING_TYPE modelPropertyNaming = MODEL_PROPERTY_NAMING_TYPE.original;
|
@Getter protected MODEL_PROPERTY_NAMING_TYPE modelPropertyNaming = MODEL_PROPERTY_NAMING_TYPE.original;
|
||||||
protected ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.PascalCase;
|
protected ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.PascalCase;
|
||||||
protected PARAM_NAMING_TYPE paramNaming = PARAM_NAMING_TYPE.camelCase;
|
@Getter protected PARAM_NAMING_TYPE paramNaming = PARAM_NAMING_TYPE.camelCase;
|
||||||
protected boolean enumPropertyNamingReplaceSpecialChar = false;
|
protected boolean enumPropertyNamingReplaceSpecialChar = false;
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean supportsES6 = false;
|
protected Boolean supportsES6 = false;
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean nullSafeAdditionalProps = false;
|
protected Boolean nullSafeAdditionalProps = false;
|
||||||
protected HashSet<String> languageGenericTypes;
|
protected HashSet<String> languageGenericTypes;
|
||||||
|
@Getter @Setter
|
||||||
protected String npmName = null;
|
protected String npmName = null;
|
||||||
|
@Getter @Setter
|
||||||
protected String npmVersion = "1.0.0";
|
protected String npmVersion = "1.0.0";
|
||||||
|
|
||||||
protected String enumSuffix = "Enum";
|
protected String enumSuffix = "Enum";
|
||||||
@ -827,14 +831,6 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MODEL_PROPERTY_NAMING_TYPE getModelPropertyNaming() {
|
|
||||||
return modelPropertyNaming;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PARAM_NAMING_TYPE getParamNaming() {
|
|
||||||
return paramNaming;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getNameUsingParamNaming(String name) {
|
private String getNameUsingParamNaming(String name) {
|
||||||
switch (getParamNaming()) {
|
switch (getParamNaming()) {
|
||||||
case original:
|
case original:
|
||||||
@ -1037,38 +1033,6 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSupportsES6(Boolean value) {
|
|
||||||
supportsES6 = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getSupportsES6() {
|
|
||||||
return supportsES6;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getNullSafeAdditionalProps() {
|
|
||||||
return nullSafeAdditionalProps;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNullSafeAdditionalProps(Boolean value) {
|
|
||||||
nullSafeAdditionalProps = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNpmName() {
|
|
||||||
return npmName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNpmName(String npmName) {
|
|
||||||
this.npmName = npmName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNpmVersion() {
|
|
||||||
return npmVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNpmVersion(String npmVersion) {
|
|
||||||
this.npmVersion = npmVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDiscriminatorValue(CodegenModel model, String baseName, String value) {
|
private void setDiscriminatorValue(CodegenModel model, String baseName, String value) {
|
||||||
for (CodegenProperty prop : model.allVars) {
|
for (CodegenProperty prop : model.allVars) {
|
||||||
if (prop.baseName.equals(baseName)) {
|
if (prop.baseName.equals(baseName)) {
|
||||||
|
@ -17,8 +17,9 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
@ -40,21 +41,26 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
public static final String ANDROID_GRADLE_VERSION = "androidGradleVersion";
|
public static final String ANDROID_GRADLE_VERSION = "androidGradleVersion";
|
||||||
public static final String ANDROID_SDK_VERSION = "androidSdkVersion";
|
public static final String ANDROID_SDK_VERSION = "androidSdkVersion";
|
||||||
public static final String ANDROID_BUILD_TOOLS_VERSION = "androidBuildToolsVersion";
|
public static final String ANDROID_BUILD_TOOLS_VERSION = "androidBuildToolsVersion";
|
||||||
|
@Getter @Setter
|
||||||
protected String invokerPackage = "org.openapitools.client";
|
protected String invokerPackage = "org.openapitools.client";
|
||||||
protected String groupId = "org.openapitools";
|
@Setter protected String groupId = "org.openapitools";
|
||||||
protected String artifactId = "openapi-android-client";
|
@Setter protected String artifactId = "openapi-android-client";
|
||||||
protected String artifactVersion = "1.0.0";
|
@Setter protected String artifactVersion = "1.0.0";
|
||||||
protected String projectFolder = "src/main";
|
protected String projectFolder = "src/main";
|
||||||
protected String sourceFolder = projectFolder + "/java";
|
@Setter protected String sourceFolder = projectFolder + "/java";
|
||||||
|
@Getter @Setter
|
||||||
protected Boolean useAndroidMavenGradlePlugin = true;
|
protected Boolean useAndroidMavenGradlePlugin = true;
|
||||||
|
@Getter @Setter
|
||||||
protected String androidGradleVersion;
|
protected String androidGradleVersion;
|
||||||
|
@Getter @Setter
|
||||||
protected String androidSdkVersion;
|
protected String androidSdkVersion;
|
||||||
|
@Getter @Setter
|
||||||
protected String androidBuildToolsVersion;
|
protected String androidBuildToolsVersion;
|
||||||
protected Boolean serializableModel = false;
|
@Setter protected Boolean serializableModel = false;
|
||||||
|
|
||||||
// requestPackage and authPackage are used by the "volley" template/library
|
// requestPackage and authPackage are used by the "volley" template/library
|
||||||
protected String requestPackage = "org.openapitools.client.request";
|
@Setter protected String requestPackage = "org.openapitools.client.request";
|
||||||
protected String authPackage = "org.openapitools.client.auth";
|
@Setter protected String authPackage = "org.openapitools.client.auth";
|
||||||
protected String gradleWrapperPackage = "gradle.wrapper";
|
protected String gradleWrapperPackage = "gradle.wrapper";
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
@ -498,74 +504,6 @@ public class AndroidClientCodegen extends DefaultCodegen implements CodegenConfi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getUseAndroidMavenGradlePlugin() {
|
|
||||||
return useAndroidMavenGradlePlugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAndroidGradleVersion() {
|
|
||||||
return androidGradleVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAndroidSdkVersion() {
|
|
||||||
return androidSdkVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAndroidBuildToolsVersion() {
|
|
||||||
return androidBuildToolsVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseAndroidMavenGradlePlugin(Boolean useAndroidMavenGradlePlugin) {
|
|
||||||
this.useAndroidMavenGradlePlugin = useAndroidMavenGradlePlugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAndroidGradleVersion(String androidGradleVersion) {
|
|
||||||
this.androidGradleVersion = androidGradleVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAndroidSdkVersion(String androidSdkVersion) {
|
|
||||||
this.androidSdkVersion = androidSdkVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAndroidBuildToolsVersion(String androidBuildToolsVersion) {
|
|
||||||
this.androidBuildToolsVersion = androidBuildToolsVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInvokerPackage() {
|
|
||||||
return invokerPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInvokerPackage(String invokerPackage) {
|
|
||||||
this.invokerPackage = invokerPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRequestPackage(String requestPackage) {
|
|
||||||
this.requestPackage = requestPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthPackage(String authPackage) {
|
|
||||||
this.authPackage = authPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupId(String groupId) {
|
|
||||||
this.groupId = groupId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactId(String artifactId) {
|
|
||||||
this.artifactId = artifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactVersion(String artifactVersion) {
|
|
||||||
this.artifactVersion = artifactVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSerializableModel(Boolean serializableModel) {
|
|
||||||
this.serializableModel = serializableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeQuotationMark(String input) {
|
public String escapeQuotationMark(String input) {
|
||||||
// remove " to avoid code injection
|
// remove " to avoid code injection
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.CliOption;
|
import org.openapitools.codegen.CliOption;
|
||||||
import org.openapitools.codegen.CodegenProperty;
|
import org.openapitools.codegen.CodegenProperty;
|
||||||
@ -45,9 +45,9 @@ public class ApexClientCodegen extends AbstractApexCodegen {
|
|||||||
private static final String NAMED_CREDENTIAL = "namedCredential";
|
private static final String NAMED_CREDENTIAL = "namedCredential";
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(ApexClientCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(ApexClientCodegen.class);
|
||||||
private String classPrefix = "OAS";
|
private String classPrefix = "OAS";
|
||||||
private String apiVersion = "42.0";
|
@Setter private String apiVersion = "42.0";
|
||||||
private String buildMethod = "sfdx";
|
private String buildMethod = "sfdx";
|
||||||
private String namedCredential;
|
@Setter private String namedCredential;
|
||||||
private String srcPath = "force-app/main/default/";
|
private String srcPath = "force-app/main/default/";
|
||||||
private String sfdxConfigPath = "config/";
|
private String sfdxConfigPath = "config/";
|
||||||
private HashMap<String, Object> primitiveDefaults = new HashMap<>();
|
private HashMap<String, Object> primitiveDefaults = new HashMap<>();
|
||||||
@ -263,20 +263,12 @@ public class ApexClientCodegen extends AbstractApexCodegen {
|
|||||||
this.buildMethod = buildMethod;
|
this.buildMethod = buildMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNamedCredential(String namedCredential) {
|
|
||||||
this.namedCredential = namedCredential;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassPrefix(String classPrefix) {
|
public void setClassPrefix(String classPrefix) {
|
||||||
// the best thing we can do without namespacing in Apex
|
// the best thing we can do without namespacing in Apex
|
||||||
modelNamePrefix = classPrefix;
|
modelNamePrefix = classPrefix;
|
||||||
this.classPrefix = classPrefix;
|
this.classPrefix = classPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setApiVersion(String apiVersion) {
|
|
||||||
this.apiVersion = apiVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String toApiVersion(String apiVersion) {
|
private String toApiVersion(String apiVersion) {
|
||||||
if (apiVersion.matches("^\\d{2}(\\.0)?$")) {
|
if (apiVersion.matches("^\\d{2}(\\.0)?$")) {
|
||||||
return apiVersion.substring(0, 2) + ".0";
|
return apiVersion.substring(0, 2) + ".0";
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -153,10 +155,15 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
|
|||||||
protected String groupId = "org.openapitools";
|
protected String groupId = "org.openapitools";
|
||||||
protected String artifactId = "openapi-client";
|
protected String artifactId = "openapi-client";
|
||||||
protected String artifactVersion = "1.0.0";
|
protected String artifactVersion = "1.0.0";
|
||||||
|
@Getter @Setter
|
||||||
protected boolean headerAttributes = true;
|
protected boolean headerAttributes = true;
|
||||||
|
@Getter @Setter
|
||||||
protected boolean useIntroduction = false;
|
protected boolean useIntroduction = false;
|
||||||
|
@Getter @Setter
|
||||||
protected boolean skipExamples = false;
|
protected boolean skipExamples = false;
|
||||||
|
@Getter @Setter
|
||||||
protected boolean useMethodAndPath = false;
|
protected boolean useMethodAndPath = false;
|
||||||
|
@Getter @Setter
|
||||||
protected boolean useTableTitles = false;
|
protected boolean useTableTitles = false;
|
||||||
|
|
||||||
private IncludeMarkupLambda includeSpecMarkupLambda;
|
private IncludeMarkupLambda includeSpecMarkupLambda;
|
||||||
@ -281,46 +288,6 @@ public class AsciidocDocumentationCodegen extends DefaultCodegen implements Code
|
|||||||
return input; // just return the original string
|
return input; // just return the original string
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHeaderAttributes() {
|
|
||||||
return headerAttributes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeaderAttributes(boolean headerAttributes) {
|
|
||||||
this.headerAttributes = headerAttributes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUseIntroduction() {
|
|
||||||
return useIntroduction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseIntroduction(boolean useIntroduction) {
|
|
||||||
this.useIntroduction = useIntroduction;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSkipExamples() {
|
|
||||||
return skipExamples;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSkipExamples(boolean skipExamples) {
|
|
||||||
this.skipExamples = skipExamples;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUseMethodAndPath() {
|
|
||||||
return useMethodAndPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseMethodAndPath(boolean useMethodAndPath) {
|
|
||||||
this.useMethodAndPath = useMethodAndPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUseTableTitles() {
|
|
||||||
return useTableTitles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseTableTitles(boolean useTableTitles) {
|
|
||||||
this.useTableTitles = useTableTitles;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processOpts() {
|
public void processOpts() {
|
||||||
super.processOpts();
|
super.processOpts();
|
||||||
|
@ -21,6 +21,7 @@ import com.samskivert.mustache.Mustache;
|
|||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -64,7 +65,7 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen {
|
|||||||
public static final String USE_DEFAULT_ROUTING = "useDefaultRouting";
|
public static final String USE_DEFAULT_ROUTING = "useDefaultRouting";
|
||||||
public static final String NEWTONSOFT_VERSION = "newtonsoftVersion";
|
public static final String NEWTONSOFT_VERSION = "newtonsoftVersion";
|
||||||
|
|
||||||
private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
@Setter private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
||||||
private String userSecretsGuid = randomUUID().toString();
|
private String userSecretsGuid = randomUUID().toString();
|
||||||
|
|
||||||
protected final Logger LOGGER = LoggerFactory.getLogger(AspNetServerCodegen.class);
|
protected final Logger LOGGER = LoggerFactory.getLogger(AspNetServerCodegen.class);
|
||||||
@ -307,11 +308,6 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen {
|
|||||||
"DateTime", "DateOnly", "DateTimeOffset", "Guid"));
|
"DateTime", "DateOnly", "DateTimeOffset", "Guid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Set<String> getValueTypes() {
|
|
||||||
return new HashSet<>(Arrays.asList("decimal", "bool", "int", "uint", "long", "ulong", "float", "double", "DateTime", "DateOnly", "DateTimeOffset", "Guid"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.SERVER;
|
return CodegenType.SERVER;
|
||||||
@ -472,10 +468,6 @@ public class AspNetServerCodegen extends AbstractCSharpCodegen {
|
|||||||
return additionalProperties.containsKey(NET_60_OR_LATER);
|
return additionalProperties.containsKey(NET_60_OR_LATER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageGuid(String packageGuid) {
|
|
||||||
this.packageGuid = packageGuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apiFileFolder() {
|
public String apiFileFolder() {
|
||||||
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Controllers";
|
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Controllers";
|
||||||
|
@ -22,10 +22,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.text.StringEscapeUtils;
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -44,14 +44,14 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
protected String apiVersion = "1.0.0";
|
protected String apiVersion = "1.0.0";
|
||||||
|
|
||||||
protected String curlOptions;
|
@Setter protected String curlOptions;
|
||||||
protected boolean processMarkdown = false;
|
@Setter protected boolean processMarkdown = false;
|
||||||
protected String scriptName = "client.sh";
|
@Setter protected String scriptName = "client.sh";
|
||||||
protected boolean generateBashCompletion = false;
|
@Setter protected boolean generateBashCompletion = false;
|
||||||
protected boolean generateZshCompletion = false;
|
@Setter protected boolean generateZshCompletion = false;
|
||||||
protected String hostEnvironmentVariable;
|
@Setter protected String hostEnvironmentVariable;
|
||||||
protected String basicAuthEnvironmentVariable;
|
@Setter protected String basicAuthEnvironmentVariable;
|
||||||
protected String apiKeyAuthEnvironmentVariable;
|
@Setter protected String apiKeyAuthEnvironmentVariable;
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
|
|
||||||
@ -333,40 +333,6 @@ public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
"Dockerfile.mustache", "", "Dockerfile"));
|
"Dockerfile.mustache", "", "Dockerfile"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurlOptions(String curlOptions) {
|
|
||||||
this.curlOptions = curlOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProcessMarkdown(boolean processMarkdown) {
|
|
||||||
this.processMarkdown = processMarkdown;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setScriptName(String scriptName) {
|
|
||||||
this.scriptName = scriptName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateBashCompletion(boolean generateBashCompletion) {
|
|
||||||
this.generateBashCompletion = generateBashCompletion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateZshCompletion(boolean generateZshCompletion) {
|
|
||||||
this.generateZshCompletion = generateZshCompletion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHostEnvironmentVariable(String hostEnvironmentVariable) {
|
|
||||||
this.hostEnvironmentVariable = hostEnvironmentVariable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBasicAuthEnvironmentVariable(String
|
|
||||||
basicAuthEnvironmentVariable) {
|
|
||||||
this.basicAuthEnvironmentVariable = basicAuthEnvironmentVariable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApiKeyAuthEnvironmentVariable(String
|
|
||||||
apiKeyAuthEnvironmentVariable) {
|
|
||||||
this.apiKeyAuthEnvironmentVariable = apiKeyAuthEnvironmentVariable;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a reserved word as defined in the `reservedWords` array. Handle
|
* Escapes a reserved word as defined in the `reservedWords` array. Handle
|
||||||
|
@ -21,6 +21,8 @@ import com.samskivert.mustache.Mustache;
|
|||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -91,8 +93,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
);
|
);
|
||||||
private static FrameworkStrategy latestFramework = frameworkStrategies.get(frameworkStrategies.size() - 1);
|
private static FrameworkStrategy latestFramework = frameworkStrategies.get(frameworkStrategies.size() - 1);
|
||||||
protected final Map<String, String> frameworks;
|
protected final Map<String, String> frameworks;
|
||||||
protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
@Setter protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
||||||
protected String clientPackage = "Client";
|
@Setter protected String clientPackage = "Client";
|
||||||
protected String authFolder = "Auth";
|
protected String authFolder = "Auth";
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
@ -110,16 +112,17 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
protected boolean supportsFileParameters = Boolean.TRUE;
|
protected boolean supportsFileParameters = Boolean.TRUE;
|
||||||
protected boolean supportsDateOnly = Boolean.FALSE;
|
protected boolean supportsDateOnly = Boolean.FALSE;
|
||||||
|
|
||||||
protected boolean validatable = Boolean.TRUE;
|
@Setter protected boolean validatable = Boolean.TRUE;
|
||||||
protected boolean equatable = Boolean.FALSE;
|
@Setter protected boolean equatable = Boolean.FALSE;
|
||||||
// By default, generated code is considered public
|
// By default, generated code is considered public
|
||||||
|
@Getter @Setter
|
||||||
protected boolean nonPublicApi = Boolean.FALSE;
|
protected boolean nonPublicApi = Boolean.FALSE;
|
||||||
|
|
||||||
protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE;
|
protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE;
|
||||||
protected String releaseNote = "Minor update";
|
protected String releaseNote = "Minor update";
|
||||||
protected String licenseId;
|
@Setter protected String licenseId;
|
||||||
protected String packageTags;
|
@Setter protected String packageTags;
|
||||||
protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
@Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
||||||
|
|
||||||
protected boolean needsCustomHttpMethod = false;
|
protected boolean needsCustomHttpMethod = false;
|
||||||
protected boolean needsUriBuilder = false;
|
protected boolean needsUriBuilder = false;
|
||||||
@ -575,14 +578,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
return CodegenType.CLIENT;
|
return CodegenType.CLIENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNonPublicApi() {
|
|
||||||
return nonPublicApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNonPublicApi(final boolean nonPublicApi) {
|
|
||||||
this.nonPublicApi = nonPublicApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String modelDocFileFolder() {
|
public String modelDocFileFolder() {
|
||||||
if (GENERICHOST.equals(getLibrary())) {
|
if (GENERICHOST.equals(getLibrary())) {
|
||||||
@ -855,10 +850,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
this.useSourceGeneration = useSourceGeneration;
|
this.useSourceGeneration = useSourceGeneration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setClientPackage(String clientPackage) {
|
|
||||||
this.clientPackage = clientPackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CodegenOperation fromOperation(String path,
|
public CodegenOperation fromOperation(String path,
|
||||||
String httpMethod,
|
String httpMethod,
|
||||||
@ -1057,11 +1048,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
public void setOptionalProjectFileFlag(boolean flag) {
|
public void setOptionalProjectFileFlag(boolean flag) {
|
||||||
this.optionalProjectFileFlag = flag;
|
this.optionalProjectFileFlag = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageGuid(String packageGuid) {
|
|
||||||
this.packageGuid = packageGuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the api name. This value must be a valid class name.
|
* Sets the api name. This value must be a valid class name.
|
||||||
*
|
*
|
||||||
@ -1136,35 +1123,15 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
.collect(Collectors.joining(";"));
|
.collect(Collectors.joining(";"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValidatable(boolean validatable) {
|
|
||||||
this.validatable = validatable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEquatable(boolean equatable) {
|
|
||||||
this.equatable = equatable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
||||||
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLicenseId(String licenseId) {
|
|
||||||
this.licenseId = licenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setReleaseNote(String releaseNote) {
|
public void setReleaseNote(String releaseNote) {
|
||||||
this.releaseNote = releaseNote;
|
this.releaseNote = releaseNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageTags(String packageTags) {
|
|
||||||
this.packageTags = packageTags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) {
|
|
||||||
this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getUseOneOfDiscriminatorLookup() {
|
public boolean getUseOneOfDiscriminatorLookup() {
|
||||||
return this.useOneOfDiscriminatorLookup;
|
return this.useOneOfDiscriminatorLookup;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import com.samskivert.mustache.Mustache;
|
|||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -55,7 +56,7 @@ public class CSharpFunctionsServerCodegen extends AbstractCSharpCodegen {
|
|||||||
public static final String NEWTONSOFT_VERSION = "newtonsoftVersion";
|
public static final String NEWTONSOFT_VERSION = "newtonsoftVersion";
|
||||||
public static final String NET_60_OR_LATER = "net60OrLater";
|
public static final String NET_60_OR_LATER = "net60OrLater";
|
||||||
|
|
||||||
private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
@Setter private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
||||||
private String userSecretsGuid = randomUUID().toString();
|
private String userSecretsGuid = randomUUID().toString();
|
||||||
|
|
||||||
protected final Logger LOGGER = LoggerFactory.getLogger(AspNetServerCodegen.class);
|
protected final Logger LOGGER = LoggerFactory.getLogger(AspNetServerCodegen.class);
|
||||||
@ -388,10 +389,6 @@ public class CSharpFunctionsServerCodegen extends AbstractCSharpCodegen {
|
|||||||
this.setTypeMapping();
|
this.setTypeMapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageGuid(String packageGuid) {
|
|
||||||
this.packageGuid = packageGuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apiFileFolder() {
|
public String apiFileFolder() {
|
||||||
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Functions";
|
return outputFolder + File.separator + sourceFolder + File.separator + packageName + File.separator + "Functions";
|
||||||
|
@ -18,9 +18,9 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.ComposedSchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -75,7 +75,7 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
|||||||
);
|
);
|
||||||
private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0;
|
private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0;
|
||||||
protected final Map<String, String> frameworks;
|
protected final Map<String, String> frameworks;
|
||||||
protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
@Setter protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
||||||
protected String clientPackage = "Org.OpenAPITools.Client";
|
protected String clientPackage = "Org.OpenAPITools.Client";
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
@ -91,16 +91,17 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
|||||||
protected boolean supportsAsync = Boolean.TRUE;
|
protected boolean supportsAsync = Boolean.TRUE;
|
||||||
protected boolean netStandard = Boolean.FALSE;
|
protected boolean netStandard = Boolean.FALSE;
|
||||||
|
|
||||||
protected boolean validatable = Boolean.TRUE;
|
@Setter protected boolean validatable = Boolean.TRUE;
|
||||||
protected Map<Character, String> regexModifiers;
|
protected Map<Character, String> regexModifiers;
|
||||||
// By default, generated code is considered public
|
// By default, generated code is considered public
|
||||||
|
@Getter @Setter
|
||||||
protected boolean nonPublicApi = Boolean.FALSE;
|
protected boolean nonPublicApi = Boolean.FALSE;
|
||||||
|
|
||||||
protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE;
|
protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE;
|
||||||
protected String releaseNote = "Minor update";
|
protected String releaseNote = "Minor update";
|
||||||
protected String licenseId;
|
@Setter protected String licenseId;
|
||||||
protected String packageTags;
|
@Setter protected String packageTags;
|
||||||
protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
@Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
||||||
|
|
||||||
protected boolean needsCustomHttpMethod = false;
|
protected boolean needsCustomHttpMethod = false;
|
||||||
protected boolean needsUriBuilder = false;
|
protected boolean needsUriBuilder = false;
|
||||||
@ -484,14 +485,6 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
|||||||
return CodegenType.CLIENT;
|
return CodegenType.CLIENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNonPublicApi() {
|
|
||||||
return nonPublicApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNonPublicApi(final boolean nonPublicApi) {
|
|
||||||
this.nonPublicApi = nonPublicApi;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String modelDocFileFolder() {
|
public String modelDocFileFolder() {
|
||||||
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||||
@ -753,10 +746,6 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
|||||||
this.optionalProjectFileFlag = flag;
|
this.optionalProjectFileFlag = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageGuid(String packageGuid) {
|
|
||||||
this.packageGuid = packageGuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPackageName(String packageName) {
|
public void setPackageName(String packageName) {
|
||||||
this.packageName = packageName;
|
this.packageName = packageName;
|
||||||
@ -821,31 +810,15 @@ public class CSharpReducedClientCodegen extends AbstractCSharpCodegen {
|
|||||||
.collect(Collectors.joining(";"));
|
.collect(Collectors.joining(";"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValidatable(boolean validatable) {
|
|
||||||
this.validatable = validatable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
||||||
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLicenseId(String licenseId) {
|
|
||||||
this.licenseId = licenseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setReleaseNote(String releaseNote) {
|
public void setReleaseNote(String releaseNote) {
|
||||||
this.releaseNote = releaseNote;
|
this.releaseNote = releaseNote;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageTags(String packageTags) {
|
|
||||||
this.packageTags = packageTags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) {
|
|
||||||
this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getUseOneOfDiscriminatorLookup() {
|
public boolean getUseOneOfDiscriminatorLookup() {
|
||||||
return this.useOneOfDiscriminatorLookup;
|
return this.useOneOfDiscriminatorLookup;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ import io.swagger.v3.oas.models.OpenAPI;
|
|||||||
import io.swagger.v3.oas.models.info.Contact;
|
import io.swagger.v3.oas.models.info.Contact;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
import io.swagger.v3.oas.models.info.License;
|
import io.swagger.v3.oas.models.info.License;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
import io.swagger.v3.parser.util.SchemaTypeUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -367,11 +366,6 @@ public abstract class CppQtAbstractCodegen extends AbstractCppCodegen implements
|
|||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toEnumValue(String value, String datatype) {
|
|
||||||
return escapeText(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDataTypeString(String dataType) {
|
public boolean isDataTypeString(String dataType) {
|
||||||
return "QString".equals(dataType);
|
return "QString".equals(dataType);
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.CodegenConfig;
|
import org.openapitools.codegen.CodegenConfig;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
@ -38,7 +39,7 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC
|
|||||||
protected String packageName = "";
|
protected String packageName = "";
|
||||||
// source folder where to write the files
|
// source folder where to write the files
|
||||||
protected String sourceFolder = "client";
|
protected String sourceFolder = "client";
|
||||||
protected boolean optionalProjectFileFlag = true;
|
@Setter protected boolean optionalProjectFileFlag = true;
|
||||||
|
|
||||||
public CppQtClientCodegen() {
|
public CppQtClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -224,10 +225,6 @@ public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenC
|
|||||||
return modelNamePrefix + sanitizeName(camelize(name)) + "Api";
|
return modelNamePrefix + sanitizeName(camelize(name)) + "Api";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOptionalProjectFileFlag(boolean flag) {
|
|
||||||
this.optionalProjectFileFlag = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels) {
|
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels) {
|
||||||
objs = super.postProcessOperationsWithModels(objs, allModels);
|
objs = super.postProcessOperationsWithModels(objs, allModels);
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
import org.openapitools.codegen.CodegenModel;
|
import org.openapitools.codegen.CodegenModel;
|
||||||
@ -52,7 +52,7 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen {
|
|||||||
// Will be included using the <> syntax, not used in Unreal's coding convention
|
// Will be included using the <> syntax, not used in Unreal's coding convention
|
||||||
protected Set<String> systemIncludes = new HashSet<>();
|
protected Set<String> systemIncludes = new HashSet<>();
|
||||||
protected String cppNamespace = unrealModuleName;
|
protected String cppNamespace = unrealModuleName;
|
||||||
protected boolean optionalProjectFileFlag = true;
|
@Setter protected boolean optionalProjectFileFlag = true;
|
||||||
|
|
||||||
public CppUE4ClientCodegen() {
|
public CppUE4ClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -246,10 +246,6 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOptionalProjectFileFlag(boolean flag) {
|
|
||||||
this.optionalProjectFileFlag = flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
// override to post-process any model properties
|
// override to post-process any model properties
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@ -561,17 +557,6 @@ public class CppUE4ClientCodegen extends AbstractCppCodegen {
|
|||||||
return modelNamePrefix + camelize(type) + "Api";
|
return modelNamePrefix + camelize(type) + "Api";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeQuotationMark(String input) {
|
|
||||||
// remove " to avoid code injection
|
|
||||||
return input.replace("\"", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeUnsafeCharacters(String input) {
|
|
||||||
return input.replace("*/", "*_/").replace("/*", "/_*");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toBooleanGetter(String name) {
|
public String toBooleanGetter(String name) {
|
||||||
return "Is" + getterAndSetterCapitalize(name);
|
return "Is" + getterAndSetterCapitalize(name);
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -50,17 +50,17 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
|||||||
private static final String NUMERIC_ENUM_PREFIX = "N";
|
private static final String NUMERIC_ENUM_PREFIX = "N";
|
||||||
protected static int emptyMethodNameCounter = 0;
|
protected static int emptyMethodNameCounter = 0;
|
||||||
|
|
||||||
protected String shardName = "openapi_client";
|
@Setter protected String shardName = "openapi_client";
|
||||||
protected String moduleName = "OpenAPIClient";
|
@Setter protected String moduleName = "OpenAPIClient";
|
||||||
protected String shardVersion = "1.0.0";
|
@Setter protected String shardVersion = "1.0.0";
|
||||||
protected String specFolder = "spec";
|
protected String specFolder = "spec";
|
||||||
protected String srcFolder = "src";
|
protected String srcFolder = "src";
|
||||||
protected String shardLicense = "unlicense";
|
@Setter protected String shardLicense = "unlicense";
|
||||||
protected String shardHomepage = "https://openapitools.org";
|
@Setter protected String shardHomepage = "https://openapitools.org";
|
||||||
protected String shardSummary = "A Crystal SDK for the REST API";
|
@Setter protected String shardSummary = "A Crystal SDK for the REST API";
|
||||||
protected String shardDescription = "This shard maps to a REST API";
|
@Setter protected String shardDescription = "This shard maps to a REST API";
|
||||||
protected String shardAuthor = "";
|
@Setter protected String shardAuthor = "";
|
||||||
protected String shardAuthorEmail = "";
|
@Setter protected String shardAuthorEmail = "";
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
protected List<String> primitiveTypes = new ArrayList<String>();
|
protected List<String> primitiveTypes = new ArrayList<String>();
|
||||||
@ -547,42 +547,6 @@ public class CrystalClientCodegen extends DefaultCodegen {
|
|||||||
return shardName + "/" + apiPackage() + "/" + toApiFilename(name);
|
return shardName + "/" + apiPackage() + "/" + toApiFilename(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShardName(String shardName) {
|
|
||||||
this.shardName = shardName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModuleName(String moduleName) {
|
|
||||||
this.moduleName = moduleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShardVersion(String shardVersion) {
|
|
||||||
this.shardVersion = shardVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShardDescription(String shardDescription) {
|
|
||||||
this.shardDescription = shardDescription;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShardSummary(String shardSummary) {
|
|
||||||
this.shardSummary = shardSummary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShardLicense(String shardLicense) {
|
|
||||||
this.shardLicense = shardLicense;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShardHomepage(String shardHomepage) {
|
|
||||||
this.shardHomepage = shardHomepage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShardAuthor(String shardAuthor) {
|
|
||||||
this.shardAuthor = shardAuthor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShardAuthorEmail(String shardAuthorEmail) {
|
|
||||||
this.shardAuthorEmail = shardAuthorEmail;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) {
|
||||||
final Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
|
final Schema additionalProperties = ModelUtils.getAdditionalProperties(schema);
|
||||||
|
@ -19,9 +19,10 @@ package org.openapitools.codegen.languages;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
|
||||||
import io.swagger.v3.oas.models.media.Discriminator;
|
import io.swagger.v3.oas.models.media.Discriminator;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -73,9 +74,12 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
|
|
||||||
private static final String CLIENT_NAME = "clientName";
|
private static final String CLIENT_NAME = "clientName";
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
private String dateLibrary;
|
private String dateLibrary;
|
||||||
|
@Getter @Setter
|
||||||
private String equalityCheckMethod;
|
private String equalityCheckMethod;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
private String clientName;
|
private String clientName;
|
||||||
|
|
||||||
private TemplateManager templateManager;
|
private TemplateManager templateManager;
|
||||||
@ -137,30 +141,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
cliOptions.add(finalProperties);
|
cliOptions.add(finalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDateLibrary() {
|
|
||||||
return dateLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDateLibrary(String library) {
|
|
||||||
this.dateLibrary = library;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEqualityCheckMethod() {
|
|
||||||
return equalityCheckMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEqualityCheckMethod(String equalityCheckMethod) {
|
|
||||||
this.equalityCheckMethod = equalityCheckMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClientName() {
|
|
||||||
return clientName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClientName(String clientName) {
|
|
||||||
this.clientName = clientName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "dart-dio";
|
return "dart-dio";
|
||||||
@ -790,13 +770,13 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
|
|
||||||
final boolean isArray;
|
final boolean isArray;
|
||||||
|
|
||||||
final boolean uniqueItems;
|
@Getter final boolean uniqueItems;
|
||||||
|
|
||||||
final boolean isMap;
|
final boolean isMap;
|
||||||
|
|
||||||
final boolean isNullable;
|
final boolean isNullable;
|
||||||
|
|
||||||
final String dataType;
|
@Getter final String dataType;
|
||||||
|
|
||||||
private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, boolean isNullable, String dataType) {
|
private BuiltValueSerializer(boolean isArray, boolean uniqueItems, boolean isMap, boolean isNullable, String dataType) {
|
||||||
this.isArray = isArray;
|
this.isArray = isArray;
|
||||||
@ -810,10 +790,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
return isArray;
|
return isArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUniqueItems() {
|
|
||||||
return uniqueItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isMap() {
|
public boolean isMap() {
|
||||||
return isMap;
|
return isMap;
|
||||||
}
|
}
|
||||||
@ -822,10 +798,6 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
|||||||
return isNullable;
|
return isNullable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDataType() {
|
|
||||||
return dataType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenProperty;
|
import org.openapitools.codegen.CodegenProperty;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
@ -34,8 +35,8 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen {
|
|||||||
private final Logger LOGGER = LoggerFactory.getLogger(EiffelClientCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(EiffelClientCodegen.class);
|
||||||
|
|
||||||
protected String libraryTarget = "openapi_eiffel_client";
|
protected String libraryTarget = "openapi_eiffel_client";
|
||||||
protected String packageName = "Eiffel";
|
@Setter protected String packageName = "Eiffel";
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String apiDocPath = "docs";
|
protected String apiDocPath = "docs";
|
||||||
protected String modelDocPath = "docs";
|
protected String modelDocPath = "docs";
|
||||||
protected String modelPath = "domain";
|
protected String modelPath = "domain";
|
||||||
@ -170,10 +171,12 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen {
|
|||||||
return outputFolder + File.separator + "src" + File.separator + "api";
|
return outputFolder + File.separator + "src" + File.separator + "api";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String modelFileFolder() {
|
public String modelFileFolder() {
|
||||||
return outputFolder + File.separator + "src" + File.separator + modelPath;
|
return outputFolder + File.separator + "src" + File.separator + modelPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String apiTestFileFolder() {
|
public String apiTestFileFolder() {
|
||||||
return outputFolder + File.separator + "test" + File.separator + "apis";
|
return outputFolder + File.separator + "test" + File.separator + "apis";
|
||||||
}
|
}
|
||||||
@ -188,14 +191,6 @@ public class EiffelClientCodegen extends AbstractEiffelCodegen {
|
|||||||
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toEnumName(CodegenProperty property) {
|
public String toEnumName(CodegenProperty property) {
|
||||||
|
@ -21,9 +21,10 @@ import com.samskivert.mustache.Mustache;
|
|||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.responses.ApiResponse;
|
import io.swagger.v3.oas.models.responses.ApiResponse;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
@ -50,7 +51,7 @@ public class ElixirClientCodegen extends DefaultCodegen {
|
|||||||
private final Pattern simpleAtomPattern = Pattern.compile("\\A(?:(?:[_@\\p{Alpha}][_@\\p{Alnum}]*[?!]?)|-)\\z");
|
private final Pattern simpleAtomPattern = Pattern.compile("\\A(?:(?:[_@\\p{Alpha}][_@\\p{Alnum}]*[?!]?)|-)\\z");
|
||||||
|
|
||||||
protected String apiVersion = "1.0.0";
|
protected String apiVersion = "1.0.0";
|
||||||
protected String moduleName;
|
@Setter protected String moduleName;
|
||||||
protected static final String defaultModuleName = "OpenAPI.Client";
|
protected static final String defaultModuleName = "OpenAPI.Client";
|
||||||
|
|
||||||
// This is the name of elixir project name;
|
// This is the name of elixir project name;
|
||||||
@ -699,7 +700,7 @@ public class ElixirClientCodegen extends DefaultCodegen {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExtendedCodegenOperation extends CodegenOperation {
|
@Getter @Setter class ExtendedCodegenOperation extends CodegenOperation {
|
||||||
private List<String> pathTemplateNames = new ArrayList<>();
|
private List<String> pathTemplateNames = new ArrayList<>();
|
||||||
private String replacedPathName;
|
private String replacedPathName;
|
||||||
|
|
||||||
@ -762,22 +763,6 @@ public class ElixirClientCodegen extends DefaultCodegen {
|
|||||||
this.operationIdCamelCase = o.operationIdCamelCase;
|
this.operationIdCamelCase = o.operationIdCamelCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getPathTemplateNames() {
|
|
||||||
return pathTemplateNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPathTemplateNames(List<String> pathTemplateNames) {
|
|
||||||
this.pathTemplateNames = pathTemplateNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReplacedPathName() {
|
|
||||||
return replacedPathName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReplacedPathName(String replacedPathName) {
|
|
||||||
this.replacedPathName = replacedPathName;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void translateBaseType(StringBuilder returnEntry, String baseType) {
|
private void translateBaseType(StringBuilder returnEntry, String baseType) {
|
||||||
switch (baseType) {
|
switch (baseType) {
|
||||||
case "AnyType":
|
case "AnyType":
|
||||||
@ -996,10 +981,6 @@ public class ElixirClientCodegen extends DefaultCodegen {
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModuleName(String moduleName) {
|
|
||||||
this.moduleName = moduleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ELIXIR; }
|
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.ELIXIR; }
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableMap;
|
|||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import com.samskivert.mustache.Mustache.Lambda;
|
import com.samskivert.mustache.Mustache.Lambda;
|
||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -52,6 +51,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
protected String packageName = "openapi";
|
protected String packageName = "openapi";
|
||||||
protected String packageVersion = "1.0.0";
|
protected String packageVersion = "1.0.0";
|
||||||
|
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.CLIENT;
|
return CodegenType.CLIENT;
|
||||||
}
|
}
|
||||||
@ -61,6 +61,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
return "elm";
|
return "elm";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates an Elm client library.";
|
return "Generates an Elm client library.";
|
||||||
}
|
}
|
||||||
@ -273,6 +274,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings({"static-method", "unchecked"})
|
@SuppressWarnings({"static-method", "unchecked"})
|
||||||
public Map<String, ModelsMap> postProcessAllModels(final Map<String, ModelsMap> orgObjs) {
|
public Map<String, ModelsMap> postProcessAllModels(final Map<String, ModelsMap> orgObjs) {
|
||||||
final Map<String, ModelsMap> objs = super.postProcessAllModels(orgObjs);
|
final Map<String, ModelsMap> objs = super.postProcessAllModels(orgObjs);
|
||||||
@ -403,6 +405,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class ParameterSorter implements Comparator<CodegenParameter> {
|
static class ParameterSorter implements Comparator<CodegenParameter> {
|
||||||
|
@Override
|
||||||
public int compare(final CodegenParameter p1, final CodegenParameter p2) {
|
public int compare(final CodegenParameter p1, final CodegenParameter p2) {
|
||||||
return index(p1) - index(p2);
|
return index(p1) - index(p2);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@ package org.openapitools.codegen.languages;
|
|||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -42,18 +44,21 @@ import static org.openapitools.codegen.utils.StringUtils.underscore;
|
|||||||
public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig {
|
public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(ErlangClientCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(ErlangClientCodegen.class);
|
||||||
|
|
||||||
protected String packageName = "openapi";
|
@Setter protected String packageName = "openapi";
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String sourceFolder = "src";
|
protected String sourceFolder = "src";
|
||||||
|
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.CLIENT;
|
return CodegenType.CLIENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "erlang-client";
|
return "erlang-client";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates an Erlang client library (beta).";
|
return "Generates an Erlang client library (beta).";
|
||||||
}
|
}
|
||||||
@ -347,14 +352,6 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of required parameters plus 1.
|
* Returns the number of required parameters plus 1.
|
||||||
*
|
*
|
||||||
@ -397,7 +394,9 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExtendedCodegenOperation extends CodegenOperation {
|
class ExtendedCodegenOperation extends CodegenOperation {
|
||||||
|
@Getter @Setter
|
||||||
private List<String> pathTemplateNames = new ArrayList<String>();
|
private List<String> pathTemplateNames = new ArrayList<String>();
|
||||||
|
@Getter @Setter
|
||||||
private String replacedPathName;
|
private String replacedPathName;
|
||||||
String arityRequired;
|
String arityRequired;
|
||||||
String arityOptional;
|
String arityOptional;
|
||||||
@ -463,21 +462,6 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
this.operationIdCamelCase = o.operationIdCamelCase;
|
this.operationIdCamelCase = o.operationIdCamelCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getPathTemplateNames() {
|
|
||||||
return pathTemplateNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPathTemplateNames(List<String> pathTemplateNames) {
|
|
||||||
this.pathTemplateNames = pathTemplateNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getReplacedPathName() {
|
|
||||||
return replacedPathName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReplacedPathName(String replacedPathName) {
|
|
||||||
this.replacedPathName = replacedPathName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,8 +18,9 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import com.samskivert.mustache.Template;
|
import com.samskivert.mustache.Template;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -43,19 +44,22 @@ import static org.openapitools.codegen.utils.StringUtils.underscore;
|
|||||||
public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig {
|
public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig {
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(ErlangProperCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(ErlangProperCodegen.class);
|
||||||
|
|
||||||
protected String packageName = "openapi";
|
@Setter protected String packageName = "openapi";
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String sourceFolder = "src";
|
protected String sourceFolder = "src";
|
||||||
protected String modelFolder = "model";
|
protected String modelFolder = "model";
|
||||||
|
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.CLIENT;
|
return CodegenType.CLIENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "erlang-proper";
|
return "erlang-proper";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates an Erlang library with PropEr generators (beta).";
|
return "Generates an Erlang library with PropEr generators (beta).";
|
||||||
}
|
}
|
||||||
@ -399,14 +403,6 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
String length(Object os) {
|
String length(Object os) {
|
||||||
int l = 1;
|
int l = 1;
|
||||||
for (CodegenParameter o : ((ExtendedCodegenOperation) os).allParams) {
|
for (CodegenParameter o : ((ExtendedCodegenOperation) os).allParams) {
|
||||||
@ -499,6 +495,7 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExtendedCodegenOperation extends CodegenOperation {
|
class ExtendedCodegenOperation extends CodegenOperation {
|
||||||
|
@Getter @Setter
|
||||||
private String replacedPathName;
|
private String replacedPathName;
|
||||||
String arity;
|
String arity;
|
||||||
|
|
||||||
@ -560,13 +557,6 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
this.operationIdCamelCase = o.operationIdCamelCase;
|
this.operationIdCamelCase = o.operationIdCamelCase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getReplacedPathName() {
|
|
||||||
return replacedPathName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReplacedPathName(String replacedPathName) {
|
|
||||||
this.replacedPathName = replacedPathName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
@ -40,8 +41,8 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
|
|
||||||
protected String apiVersion = "1.0.0";
|
protected String apiVersion = "1.0.0";
|
||||||
protected String apiPath = "src";
|
protected String apiPath = "src";
|
||||||
protected String packageName = "openapi";
|
@Setter protected String packageName = "openapi";
|
||||||
protected String openApiSpecName = "openapi";
|
@Setter protected String openApiSpecName = "openapi";
|
||||||
|
|
||||||
public ErlangServerCodegen() {
|
public ErlangServerCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -289,14 +290,6 @@ public class ErlangServerCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return super.postProcessSupportingFileData(objs);
|
return super.postProcessSupportingFileData(objs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageName(String packageName) {
|
|
||||||
this.packageName = packageName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOpenApiSpecName(String openApiSpecName) {
|
|
||||||
this.openApiSpecName = openApiSpecName;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String toHandlerName(String name) {
|
protected String toHandlerName(String name) {
|
||||||
return toModuleName(name) + "_handler";
|
return toModuleName(name) + "_handler";
|
||||||
}
|
}
|
||||||
|
@ -31,14 +31,17 @@ public class FsharpFunctionsServerCodegen extends AbstractFSharpCodegen {
|
|||||||
|
|
||||||
final Logger LOGGER = LoggerFactory.getLogger(FsharpFunctionsServerCodegen.class);
|
final Logger LOGGER = LoggerFactory.getLogger(FsharpFunctionsServerCodegen.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.SERVER;
|
return CodegenType.SERVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "fsharp-functions";
|
return "fsharp-functions";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a fsharp-functions server (beta).";
|
return "Generates a fsharp-functions server (beta).";
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ package org.openapitools.codegen.languages;
|
|||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenOperation;
|
import org.openapitools.codegen.CodegenOperation;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
@ -47,7 +48,7 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen {
|
|||||||
public static final String SDK_WEB = "Microsoft.NET.Sdk.Web";
|
public static final String SDK_WEB = "Microsoft.NET.Sdk.Web";
|
||||||
public static final String SDK_LIB = "Microsoft.NET.Sdk";
|
public static final String SDK_LIB = "Microsoft.NET.Sdk";
|
||||||
|
|
||||||
private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
@Setter private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}";
|
||||||
|
|
||||||
@SuppressWarnings("hiding")
|
@SuppressWarnings("hiding")
|
||||||
protected final Logger LOGGER = LoggerFactory.getLogger(FsharpGiraffeServerCodegen.class);
|
protected final Logger LOGGER = LoggerFactory.getLogger(FsharpGiraffeServerCodegen.class);
|
||||||
@ -211,10 +212,6 @@ public class FsharpGiraffeServerCodegen extends AbstractFSharpCodegen {
|
|||||||
LOGGER.warn("Swashbuckle flag not currently supported, this will be ignored.");
|
LOGGER.warn("Swashbuckle flag not currently supported, this will be ignored.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackageGuid(String packageGuid) {
|
|
||||||
this.packageGuid = packageGuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String modelFileFolder() {
|
public String modelFileFolder() {
|
||||||
return super.modelFileFolder().replace("Model", "model");
|
return super.modelFileFolder().replace("Model", "model");
|
||||||
|
@ -19,9 +19,9 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.samskivert.mustache.Mustache;
|
import com.samskivert.mustache.Mustache;
|
||||||
import com.samskivert.mustache.Template;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||||
@ -37,8 +37,6 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Writer;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER;
|
||||||
@ -47,7 +45,7 @@ import static org.openapitools.codegen.utils.StringUtils.camelize;
|
|||||||
public class GoClientCodegen extends AbstractGoCodegen {
|
public class GoClientCodegen extends AbstractGoCodegen {
|
||||||
|
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(GoClientCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(GoClientCodegen.class);
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected String apiDocPath = "docs/";
|
protected String apiDocPath = "docs/";
|
||||||
protected String modelDocPath = "docs/";
|
protected String modelDocPath = "docs/";
|
||||||
protected String modelFileFolder = null;
|
protected String modelFileFolder = null;
|
||||||
@ -57,9 +55,9 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
public static final String GENERATE_INTERFACES = "generateInterfaces";
|
public static final String GENERATE_INTERFACES = "generateInterfaces";
|
||||||
public static final String MODEL_FILE_FOLDER = "modelFileFolder";
|
public static final String MODEL_FILE_FOLDER = "modelFileFolder";
|
||||||
public static final String WITH_GO_MOD = "withGoMod";
|
public static final String WITH_GO_MOD = "withGoMod";
|
||||||
protected String goImportAlias = "openapiclient";
|
@Setter protected String goImportAlias = "openapiclient";
|
||||||
protected boolean isGoSubmodule = false;
|
protected boolean isGoSubmodule = false;
|
||||||
protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
@Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
||||||
|
|
||||||
// A cache to efficiently lookup schema `toModelName()` based on the schema Key
|
// A cache to efficiently lookup schema `toModelName()` based on the schema Key
|
||||||
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
|
||||||
@ -169,7 +167,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
* Configures the type of generator.
|
* Configures the type of generator.
|
||||||
*
|
*
|
||||||
* @return the CodegenType for this generator
|
* @return the CodegenType for this generator
|
||||||
* @see org.openapitools.codegen.CodegenType
|
* @see CodegenType
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
@ -312,22 +310,10 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("utils.mustache", "", "utils.go"));
|
supportingFiles.add(new SupportingFile("utils.mustache", "", "utils.go"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) {
|
|
||||||
this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getUseOneOfDiscriminatorLookup() {
|
public boolean getUseOneOfDiscriminatorLookup() {
|
||||||
return this.useOneOfDiscriminatorLookup;
|
return this.useOneOfDiscriminatorLookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGoImportAlias(String goImportAlias) {
|
|
||||||
this.goImportAlias = goImportAlias;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsGoSubmodule(boolean isGoSubmodule) {
|
public void setIsGoSubmodule(boolean isGoSubmodule) {
|
||||||
this.isGoSubmodule = isGoSubmodule;
|
this.isGoSubmodule = isGoSubmodule;
|
||||||
}
|
}
|
||||||
@ -374,12 +360,6 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
return toModelName(name);
|
return toModelName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toApiDocFilename(String name) {
|
|
||||||
return toApiName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toModelName(String name) {
|
public String toModelName(String name) {
|
||||||
if (schemaKeyToModelNameCache.containsKey(name)) {
|
if (schemaKeyToModelNameCache.containsKey(name)) {
|
||||||
@ -392,6 +372,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
return camelizedName;
|
return camelizedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String escapeReservedWord(String name) {
|
public String escapeReservedWord(String name) {
|
||||||
if (this.reservedWordsMappings().containsKey(name)) {
|
if (this.reservedWordsMappings().containsKey(name)) {
|
||||||
return this.reservedWordsMappings().get(name);
|
return this.reservedWordsMappings().get(name);
|
||||||
@ -424,7 +405,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
|||||||
/**
|
/**
|
||||||
* Determines if at least one of the allOf pieces of a schema are of type string
|
* Determines if at least one of the allOf pieces of a schema are of type string
|
||||||
*
|
*
|
||||||
* @param p
|
* @param schema
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean isAllOfStringSchema(Schema schema) {
|
private boolean isAllOfStringSchema(Schema schema) {
|
||||||
|
@ -28,7 +28,6 @@ import java.io.File;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class GoEchoServerCodegen extends AbstractGoCodegen {
|
public class GoEchoServerCodegen extends AbstractGoCodegen {
|
||||||
protected String apiVersion = "1.0.0";
|
protected String apiVersion = "1.0.0";
|
||||||
@ -40,14 +39,17 @@ public class GoEchoServerCodegen extends AbstractGoCodegen {
|
|||||||
private static final String API_PACKAGE_NAME = "handlers";
|
private static final String API_PACKAGE_NAME = "handlers";
|
||||||
private static final String OUTPUT_PATH = "generated-code" + File.separator + "go-echo-server";
|
private static final String OUTPUT_PATH = "generated-code" + File.separator + "go-echo-server";
|
||||||
|
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.SERVER;
|
return CodegenType.SERVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "go-echo-server";
|
return "go-echo-server";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a go-echo server. (Beta)";
|
return "Generates a go-echo server. (Beta)";
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.CliOption;
|
import org.openapitools.codegen.CliOption;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenOperation;
|
import org.openapitools.codegen.CodegenOperation;
|
||||||
@ -32,7 +33,6 @@ import java.io.File;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class GoGinServerCodegen extends AbstractGoCodegen {
|
public class GoGinServerCodegen extends AbstractGoCodegen {
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ public class GoGinServerCodegen extends AbstractGoCodegen {
|
|||||||
|
|
||||||
public static final String INTERFACE_ONLY = "interfaceOnly";
|
public static final String INTERFACE_ONLY = "interfaceOnly";
|
||||||
|
|
||||||
protected boolean interfaceOnly = false;
|
@Setter protected boolean interfaceOnly = false;
|
||||||
|
|
||||||
protected String apiVersion = "1.0.0";
|
protected String apiVersion = "1.0.0";
|
||||||
protected int serverPort = 8080;
|
protected int serverPort = 8080;
|
||||||
@ -209,10 +209,6 @@ public class GoGinServerCodegen extends AbstractGoCodegen {
|
|||||||
supportingFiles.add(new SupportingFile("go.mod.mustache", "go.mod"));
|
supportingFiles.add(new SupportingFile("go.mod.mustache", "go.mod"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInterfaceOnly(boolean interfaceOnly) {
|
|
||||||
this.interfaceOnly = interfaceOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apiPackage() {
|
public String apiPackage() {
|
||||||
return apiPath;
|
return apiPath;
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.*;
|
import org.openapitools.codegen.meta.features.*;
|
||||||
@ -52,14 +53,14 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
|||||||
|
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(GoServerCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(GoServerCodegen.class);
|
||||||
|
|
||||||
protected String packageVersion = "1.0.0";
|
@Setter protected String packageVersion = "1.0.0";
|
||||||
protected int serverPort = 8080;
|
@Setter protected int serverPort = 8080;
|
||||||
protected String projectName = "openapi-server";
|
protected String projectName = "openapi-server";
|
||||||
protected String sourceFolder = "go";
|
@Setter protected String sourceFolder = "go";
|
||||||
protected Boolean corsFeatureEnabled = false;
|
protected Boolean corsFeatureEnabled = false;
|
||||||
protected Boolean addResponseHeaders = false;
|
@Setter protected Boolean addResponseHeaders = false;
|
||||||
protected Boolean outputAsLibrary = false;
|
@Setter protected Boolean outputAsLibrary = false;
|
||||||
protected Boolean onlyInterfaces = false;
|
@Setter protected Boolean onlyInterfaces = false;
|
||||||
|
|
||||||
|
|
||||||
public GoServerCodegen() {
|
public GoServerCodegen() {
|
||||||
@ -474,32 +475,8 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
|||||||
return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar);
|
return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSourceFolder(String sourceFolder) {
|
|
||||||
this.sourceFolder = sourceFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPackageVersion(String packageVersion) {
|
|
||||||
this.packageVersion = packageVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setServerPort(int serverPort) {
|
|
||||||
this.serverPort = serverPort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFeatureCORS(Boolean featureCORS) {
|
public void setFeatureCORS(Boolean featureCORS) {
|
||||||
this.corsFeatureEnabled = featureCORS;
|
this.corsFeatureEnabled = featureCORS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddResponseHeaders(Boolean addResponseHeaders) {
|
|
||||||
this.addResponseHeaders = addResponseHeaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnlyInterfaces(Boolean onlyInterfaces) {
|
|
||||||
this.onlyInterfaces = onlyInterfaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOutputAsLibrary(Boolean outputAsLibrary) {
|
|
||||||
this.outputAsLibrary = outputAsLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
|
@ -32,10 +32,12 @@ public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements Code
|
|||||||
return CodegenType.SCHEMA;
|
return CodegenType.SCHEMA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "graphql-schema";
|
return "graphql-schema";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates GraphQL schema files (beta)";
|
return "Generates GraphQL schema files (beta)";
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ import static org.openapitools.codegen.utils.StringUtils.camelize;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.meta.features.ClientModificationFeature;
|
import org.openapitools.codegen.meta.features.ClientModificationFeature;
|
||||||
@ -154,11 +153,6 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
|
|||||||
return input.replace("'", "");
|
return input.replace("'", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String escapeUnsafeCharacters(String input) {
|
|
||||||
return input.replace("*/", "*_/").replace("/*", "/_*");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GROOVY; }
|
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.GROOVY; }
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
@ -147,14 +146,17 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
|||||||
|
|
||||||
final private static Pattern CONTAINS_JSON_MIME_PATTERN = Pattern.compile("(?i)application/.*json(;.*)?");
|
final private static Pattern CONTAINS_JSON_MIME_PATTERN = Pattern.compile("(?i)application/.*json(;.*)?");
|
||||||
|
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.CLIENT;
|
return CodegenType.CLIENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "haskell-http-client";
|
return "haskell-http-client";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a Haskell http-client library.";
|
return "Generates a Haskell http-client library.";
|
||||||
}
|
}
|
||||||
@ -1214,6 +1216,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
|||||||
return toTypeName("Model", name);
|
return toTypeName("Model", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toApiName(String name) {
|
public String toApiName(String name) {
|
||||||
if (name.length() == 0) {
|
if (name.length() == 0) {
|
||||||
return "Default";
|
return "Default";
|
||||||
@ -1434,6 +1437,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
|||||||
}
|
}
|
||||||
|
|
||||||
// override with any special text escaping logic
|
// override with any special text escaping logic
|
||||||
|
@Override
|
||||||
@SuppressWarnings("static-method")
|
@SuppressWarnings("static-method")
|
||||||
public String escapeText(String input) {
|
public String escapeText(String input) {
|
||||||
if (input == null) {
|
if (input == null) {
|
||||||
|
@ -19,7 +19,6 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
@ -59,6 +58,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
|
|||||||
*
|
*
|
||||||
* @return the CodegenType for this generator
|
* @return the CodegenType for this generator
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.SERVER;
|
return CodegenType.SERVER;
|
||||||
}
|
}
|
||||||
@ -69,6 +69,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
|
|||||||
*
|
*
|
||||||
* @return the friendly name for the generator
|
* @return the friendly name for the generator
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "haskell";
|
return "haskell";
|
||||||
}
|
}
|
||||||
@ -79,6 +80,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
|
|||||||
*
|
*
|
||||||
* @return A string value for the help message
|
* @return A string value for the help message
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a Haskell server and client library.";
|
return "Generates a Haskell server and client library.";
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,10 @@ package org.openapitools.codegen.languages;
|
|||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -49,37 +50,26 @@ public class HaskellYesodServerCodegen extends DefaultCodegen implements Codegen
|
|||||||
|
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(HaskellYesodServerCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(HaskellYesodServerCodegen.class);
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
protected String projectName;
|
protected String projectName;
|
||||||
|
@Getter @Setter
|
||||||
protected String apiModuleName;
|
protected String apiModuleName;
|
||||||
|
|
||||||
|
@Override
|
||||||
public CodegenType getTag() {
|
public CodegenType getTag() {
|
||||||
return CodegenType.SERVER;
|
return CodegenType.SERVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "haskell-yesod";
|
return "haskell-yesod";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a haskell-yesod server.";
|
return "Generates a haskell-yesod server.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProjectName() {
|
|
||||||
return projectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProjectName(String projectName) {
|
|
||||||
this.projectName = projectName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getApiModuleName() {
|
|
||||||
return apiModuleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApiModuleName(String apiModuleName) {
|
|
||||||
this.apiModuleName = apiModuleName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HaskellYesodServerCodegen() {
|
public HaskellYesodServerCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ package org.openapitools.codegen.languages;
|
|||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.PathItem;
|
import io.swagger.v3.oas.models.PathItem;
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import org.openapitools.codegen.CodegenConfig;
|
import org.openapitools.codegen.CodegenConfig;
|
||||||
import org.openapitools.codegen.CodegenType;
|
import org.openapitools.codegen.CodegenType;
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
||||||
import org.openapitools.codegen.languages.features.GzipTestFeatures;
|
import org.openapitools.codegen.languages.features.GzipTestFeatures;
|
||||||
@ -45,17 +47,17 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
|
|||||||
|
|
||||||
public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles";
|
public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles";
|
||||||
|
|
||||||
protected boolean useBeanValidation = false;
|
@Getter protected boolean useBeanValidation = false;
|
||||||
|
|
||||||
protected boolean useGenericResponse = false;
|
@Getter protected boolean useGenericResponse = false;
|
||||||
|
|
||||||
protected boolean useGzipFeatureForTests = false;
|
@Getter protected boolean useGzipFeatureForTests = false;
|
||||||
|
|
||||||
protected boolean useLoggingFeatureForTests = false;
|
@Getter protected boolean useLoggingFeatureForTests = false;
|
||||||
|
|
||||||
private boolean useJackson = false;
|
@Getter private boolean useJackson = false;
|
||||||
|
|
||||||
protected boolean useAbstractionForFiles = false;
|
@Setter protected boolean useAbstractionForFiles = false;
|
||||||
|
|
||||||
public JavaCXFClientCodegen() {
|
public JavaCXFClientCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -193,42 +195,19 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
|
|||||||
this.useBeanValidation = useBeanValidation;
|
this.useBeanValidation = useBeanValidation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseBeanValidation() {
|
|
||||||
return useBeanValidation;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests) {
|
public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests) {
|
||||||
this.useGzipFeatureForTests = useGzipFeatureForTests;
|
this.useGzipFeatureForTests = useGzipFeatureForTests;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseGzipFeatureForTests() {
|
|
||||||
return useGzipFeatureForTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests) {
|
public void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests) {
|
||||||
this.useLoggingFeatureForTests = useLoggingFeatureForTests;
|
this.useLoggingFeatureForTests = useLoggingFeatureForTests;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseLoggingFeatureForTests() {
|
|
||||||
return useLoggingFeatureForTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUseGenericResponse(boolean useGenericResponse) {
|
public void setUseGenericResponse(boolean useGenericResponse) {
|
||||||
this.useGenericResponse = useGenericResponse;
|
this.useGenericResponse = useGenericResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUseGenericResponse() {
|
|
||||||
return useGenericResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUseJackson() {
|
|
||||||
return useJackson;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseAbstractionForFiles(boolean useAbstractionForFiles) {
|
|
||||||
this.useAbstractionForFiles = useAbstractionForFiles;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import java.text.ParseException;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.text.StringEscapeUtils;
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.CliOption;
|
import org.openapitools.codegen.CliOption;
|
||||||
@ -312,19 +313,19 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
|
|||||||
|
|
||||||
private final Map<String, Generex> REGEX_GENERATORS = new HashMap<>();
|
private final Map<String, Generex> REGEX_GENERATORS = new HashMap<>();
|
||||||
|
|
||||||
protected boolean generateOperationBody = false;
|
@Setter protected boolean generateOperationBody = false;
|
||||||
|
|
||||||
protected boolean loadTestDataFromFile = false;
|
@Setter protected boolean loadTestDataFromFile = false;
|
||||||
|
|
||||||
protected boolean supportMultipleSpringServices = false;
|
@Setter protected boolean supportMultipleSpringServices = false;
|
||||||
|
|
||||||
protected JsonCache testDataCache = null;
|
protected JsonCache testDataCache = null;
|
||||||
|
|
||||||
protected JsonCache testDataControlCache = null;
|
protected JsonCache testDataControlCache = null;
|
||||||
|
|
||||||
protected File testDataFile = null;
|
@Setter protected File testDataFile = null;
|
||||||
|
|
||||||
protected File testDataControlFile = null;
|
@Setter protected File testDataControlFile = null;
|
||||||
|
|
||||||
public JavaCXFExtServerCodegen() {
|
public JavaCXFExtServerCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -1403,26 +1404,6 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGenerateOperationBody(boolean generateOperationBody) {
|
|
||||||
this.generateOperationBody = generateOperationBody;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoadTestDataFromFile(boolean loadTestDataFromFile) {
|
|
||||||
this.loadTestDataFromFile = loadTestDataFromFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportMultipleSpringServices(boolean supportMultipleSpringServices) {
|
|
||||||
this.supportMultipleSpringServices = supportMultipleSpringServices;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestDataControlFile(File testDataControlFile) {
|
|
||||||
this.testDataControlFile = testDataControlFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestDataFile(File testDataFile) {
|
|
||||||
this.testDataFile = testDataFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toDefaultValue(Schema p) {
|
public String toDefaultValue(Schema p) {
|
||||||
if (ModelUtils.isGenerateAliasAsModel(p) && StringUtils.isNotEmpty(p.get$ref())) {
|
if (ModelUtils.isGenerateAliasAsModel(p) && StringUtils.isNotEmpty(p.get$ref())) {
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.languages;
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ComposedSchema;
|
import lombok.Setter;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
import org.openapitools.codegen.languages.features.CXFServerFeatures;
|
import org.openapitools.codegen.languages.features.CXFServerFeatures;
|
||||||
import org.openapitools.codegen.languages.features.GzipTestFeatures;
|
import org.openapitools.codegen.languages.features.GzipTestFeatures;
|
||||||
@ -26,7 +25,6 @@ import org.openapitools.codegen.languages.features.LoggingTestFeatures;
|
|||||||
import org.openapitools.codegen.languages.features.UseGenericResponseFeatures;
|
import org.openapitools.codegen.languages.features.UseGenericResponseFeatures;
|
||||||
import org.openapitools.codegen.model.ModelMap;
|
import org.openapitools.codegen.model.ModelMap;
|
||||||
import org.openapitools.codegen.model.OperationsMap;
|
import org.openapitools.codegen.model.OperationsMap;
|
||||||
import org.openapitools.codegen.utils.ModelUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -39,41 +37,41 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
|||||||
|
|
||||||
public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles";
|
public static final String USE_ABSTRACTION_FOR_FILES = "useAbstractionForFiles";
|
||||||
|
|
||||||
protected boolean addConsumesProducesJson = true;
|
@Setter protected boolean addConsumesProducesJson = true;
|
||||||
|
|
||||||
protected boolean generateSpringApplication = false;
|
@Setter protected boolean generateSpringApplication = false;
|
||||||
|
|
||||||
protected boolean useSpringAnnotationConfig = false;
|
@Setter protected boolean useSpringAnnotationConfig = false;
|
||||||
|
|
||||||
protected boolean useSwaggerFeature = false;
|
@Setter protected boolean useSwaggerFeature = false;
|
||||||
|
|
||||||
protected boolean useSwaggerUI = false;
|
@Setter protected boolean useSwaggerUI = false;
|
||||||
|
|
||||||
protected boolean useWadlFeature = false;
|
@Setter protected boolean useWadlFeature = false;
|
||||||
|
|
||||||
protected boolean useMultipartFeature = false;
|
@Setter protected boolean useMultipartFeature = false;
|
||||||
|
|
||||||
protected boolean useBeanValidationFeature = false;
|
@Setter protected boolean useBeanValidationFeature = false;
|
||||||
|
|
||||||
protected boolean generateSpringBootApplication = false;
|
@Setter protected boolean generateSpringBootApplication = false;
|
||||||
|
|
||||||
protected boolean generateJbossDeploymentDescriptor = false;
|
@Setter protected boolean generateJbossDeploymentDescriptor = false;
|
||||||
|
|
||||||
protected boolean useGzipFeature = false;
|
@Setter protected boolean useGzipFeature = false;
|
||||||
|
|
||||||
protected boolean useGzipFeatureForTests = false;
|
@Setter protected boolean useGzipFeatureForTests = false;
|
||||||
|
|
||||||
protected boolean useLoggingFeature = false;
|
@Setter protected boolean useLoggingFeature = false;
|
||||||
|
|
||||||
protected boolean useLoggingFeatureForTests = false;
|
@Setter protected boolean useLoggingFeatureForTests = false;
|
||||||
|
|
||||||
protected boolean useAnnotatedBasePath = false;
|
@Setter protected boolean useAnnotatedBasePath = false;
|
||||||
|
|
||||||
protected boolean generateNonSpringApplication = false;
|
@Setter protected boolean generateNonSpringApplication = false;
|
||||||
|
|
||||||
protected boolean useGenericResponse = false;
|
@Setter protected boolean useGenericResponse = false;
|
||||||
|
|
||||||
protected boolean useAbstractionForFiles = false;
|
@Setter protected boolean useAbstractionForFiles = false;
|
||||||
|
|
||||||
public JavaCXFServerCodegen() {
|
public JavaCXFServerCodegen() {
|
||||||
super();
|
super();
|
||||||
@ -276,81 +274,5 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
|
|||||||
return "Generates a Java JAXRS Server application based on Apache CXF framework.";
|
return "Generates a Java JAXRS Server application based on Apache CXF framework.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGenerateSpringApplication(boolean generateSpringApplication) {
|
|
||||||
this.generateSpringApplication = generateSpringApplication;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig) {
|
|
||||||
this.useSpringAnnotationConfig = useSpringAnnotationConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseSwaggerFeature(boolean useSwaggerFeature) {
|
|
||||||
this.useSwaggerFeature = useSwaggerFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setUseWadlFeature(boolean useWadlFeature) {
|
|
||||||
this.useWadlFeature = useWadlFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setUseMultipartFeature(boolean useMultipartFeature) {
|
|
||||||
this.useMultipartFeature = useMultipartFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setUseGzipFeature(boolean useGzipFeature) {
|
|
||||||
this.useGzipFeature = useGzipFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setUseLoggingFeature(boolean useLoggingFeature) {
|
|
||||||
this.useLoggingFeature = useLoggingFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setUseBeanValidationFeature(boolean useBeanValidationFeature) {
|
|
||||||
this.useBeanValidationFeature = useBeanValidationFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateSpringBootApplication(boolean generateSpringBootApplication) {
|
|
||||||
this.generateSpringBootApplication = generateSpringBootApplication;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor) {
|
|
||||||
this.generateJbossDeploymentDescriptor = generateJbossDeploymentDescriptor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests) {
|
|
||||||
this.useGzipFeatureForTests = useGzipFeatureForTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests) {
|
|
||||||
this.useLoggingFeatureForTests = useLoggingFeatureForTests;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseSwaggerUI(boolean useSwaggerUI) {
|
|
||||||
this.useSwaggerUI = useSwaggerUI;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAddConsumesProducesJson(boolean addConsumesProducesJson) {
|
|
||||||
this.addConsumesProducesJson = addConsumesProducesJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseAnnotatedBasePath(boolean useAnnotatedBasePath) {
|
|
||||||
this.useAnnotatedBasePath = useAnnotatedBasePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateNonSpringApplication(boolean generateNonSpringApplication) {
|
|
||||||
this.generateNonSpringApplication = generateNonSpringApplication;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseGenericResponse(boolean useGenericResponse) {
|
|
||||||
this.useGenericResponse = useGenericResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseAbstractionForFiles(boolean useAbstractionForFiles) {
|
|
||||||
this.useAbstractionForFiles = useAbstractionForFiles;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package org.openapitools.codegen.languages;
|
|||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import org.openapitools.codegen.CliOption;
|
import org.openapitools.codegen.CliOption;
|
||||||
import org.openapitools.codegen.CodegenOperation;
|
import org.openapitools.codegen.CodegenOperation;
|
||||||
import org.openapitools.codegen.CodegenType;
|
|
||||||
import org.openapitools.codegen.SupportingFile;
|
import org.openapitools.codegen.SupportingFile;
|
||||||
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
|
||||||
import org.openapitools.codegen.languages.features.OptionalFeatures;
|
import org.openapitools.codegen.languages.features.OptionalFeatures;
|
||||||
@ -58,14 +57,12 @@ public class JavaCamelServerCodegen extends SpringCodegen implements BeanValidat
|
|||||||
|
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(JavaCamelServerCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(JavaCamelServerCodegen.class);
|
||||||
|
|
||||||
public CodegenType getTag() {
|
@Override
|
||||||
return CodegenType.SERVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "java-camel";
|
return "java-camel";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a Java Camel server (beta).";
|
return "Generates a Java Camel server (beta).";
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,9 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.*;
|
import org.openapitools.codegen.*;
|
||||||
@ -110,39 +113,45 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
protected boolean useRxJava3 = false;
|
protected boolean useRxJava3 = false;
|
||||||
// backwards compatibility for openapi configs that specify neither rx1 nor rx2
|
// backwards compatibility for openapi configs that specify neither rx1 nor rx2
|
||||||
// (mustache does not allow for boolean operators so we need this extra field)
|
// (mustache does not allow for boolean operators so we need this extra field)
|
||||||
protected boolean doNotUseRx = true;
|
@Setter protected boolean doNotUseRx = true;
|
||||||
protected boolean usePlayWS = false;
|
@Setter protected boolean usePlayWS = false;
|
||||||
protected String microprofileFramework = MICROPROFILE_DEFAULT;
|
@Setter protected String microprofileFramework = MICROPROFILE_DEFAULT;
|
||||||
protected boolean microprofileMutiny = false;
|
@Setter protected boolean microprofileMutiny = false;
|
||||||
protected String configKey = null;
|
@Setter protected String configKey = null;
|
||||||
protected boolean configKeyFromClassName = false;
|
@Setter(AccessLevel.PRIVATE) protected boolean configKeyFromClassName = false;
|
||||||
|
|
||||||
protected boolean asyncNative = false;
|
@Setter protected boolean asyncNative = false;
|
||||||
protected boolean parcelableModel = false;
|
@Setter protected boolean parcelableModel = false;
|
||||||
protected boolean useBeanValidation = false;
|
@Setter protected boolean useBeanValidation = false;
|
||||||
protected boolean performBeanValidation = false;
|
@Setter protected boolean performBeanValidation = false;
|
||||||
protected boolean useGzipFeature = false;
|
@Setter protected boolean useGzipFeature = false;
|
||||||
protected boolean useRuntimeException = false;
|
@Setter protected boolean useRuntimeException = false;
|
||||||
protected boolean useReflectionEqualsHashCode = false;
|
@Setter protected boolean useReflectionEqualsHashCode = false;
|
||||||
protected boolean caseInsensitiveResponseHeaders = false;
|
protected boolean caseInsensitiveResponseHeaders = false;
|
||||||
protected boolean useAbstractionForFiles = false;
|
@Setter protected boolean useAbstractionForFiles = false;
|
||||||
protected boolean dynamicOperations = false;
|
@Setter protected boolean dynamicOperations = false;
|
||||||
protected boolean supportStreaming = false;
|
@Setter protected boolean supportStreaming = false;
|
||||||
protected boolean withAWSV4Signature = false;
|
@Setter protected boolean withAWSV4Signature = false;
|
||||||
protected String gradleProperties;
|
@Setter protected String gradleProperties;
|
||||||
protected String errorObjectType;
|
@Setter protected String errorObjectType;
|
||||||
protected String authFolder;
|
protected String authFolder;
|
||||||
protected String serializationLibrary = null;
|
/**
|
||||||
protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
* -- GETTER --
|
||||||
|
* Serialization library.
|
||||||
|
*
|
||||||
|
* @return 'gson' or 'jackson'
|
||||||
|
*/
|
||||||
|
@Getter protected String serializationLibrary = null;
|
||||||
|
@Setter protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup
|
||||||
protected String rootJavaEEPackage;
|
protected String rootJavaEEPackage;
|
||||||
protected Map<String, MpRestClientVersion> mpRestClientVersions = new LinkedHashMap<>();
|
protected Map<String, MpRestClientVersion> mpRestClientVersions = new LinkedHashMap<>();
|
||||||
protected boolean useSingleRequestParameter = false;
|
@Setter(AccessLevel.PRIVATE) protected boolean useSingleRequestParameter = false;
|
||||||
protected boolean webclientBlockingOperations = false;
|
protected boolean webclientBlockingOperations = false;
|
||||||
protected boolean generateClientAsBean = false;
|
@Setter protected boolean generateClientAsBean = false;
|
||||||
protected boolean useEnumCaseInsensitive = false;
|
@Setter protected boolean useEnumCaseInsensitive = false;
|
||||||
|
|
||||||
protected int maxAttemptsForRetry = 1;
|
@Setter protected int maxAttemptsForRetry = 1;
|
||||||
protected long waitTimeMillis = 10l;
|
@Setter protected long waitTimeMillis = 10l;
|
||||||
|
|
||||||
private static class MpRestClientVersion {
|
private static class MpRestClientVersion {
|
||||||
public final String rootPackage;
|
public final String rootPackage;
|
||||||
@ -1172,10 +1181,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) {
|
|
||||||
this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getUseOneOfDiscriminatorLookup() {
|
public boolean getUseOneOfDiscriminatorLookup() {
|
||||||
return this.useOneOfDiscriminatorLookup;
|
return this.useOneOfDiscriminatorLookup;
|
||||||
}
|
}
|
||||||
@ -1184,10 +1189,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
return useSingleRequestParameter;
|
return useSingleRequestParameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUseSingleRequestParameter(boolean useSingleRequestParameter) {
|
|
||||||
this.useSingleRequestParameter = useSingleRequestParameter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseRxJava(boolean useRxJava) {
|
public void setUseRxJava(boolean useRxJava) {
|
||||||
this.useRxJava = useRxJava;
|
this.useRxJava = useRxJava;
|
||||||
doNotUseRx = false;
|
doNotUseRx = false;
|
||||||
@ -1203,107 +1204,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
doNotUseRx = false;
|
doNotUseRx = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDoNotUseRx(boolean doNotUseRx) {
|
|
||||||
this.doNotUseRx = doNotUseRx;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsePlayWS(boolean usePlayWS) {
|
|
||||||
this.usePlayWS = usePlayWS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAsyncNative(boolean asyncNative) {
|
|
||||||
this.asyncNative = asyncNative;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMicroprofileFramework(String microprofileFramework) {
|
|
||||||
this.microprofileFramework = microprofileFramework;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMicroprofileMutiny(boolean microprofileMutiny) {
|
|
||||||
this.microprofileMutiny = microprofileMutiny;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConfigKey(String configKey) {
|
|
||||||
this.configKey = configKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParcelableModel(boolean parcelableModel) {
|
|
||||||
this.parcelableModel = parcelableModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseBeanValidation(boolean useBeanValidation) {
|
|
||||||
this.useBeanValidation = useBeanValidation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPerformBeanValidation(boolean performBeanValidation) {
|
|
||||||
this.performBeanValidation = performBeanValidation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseGzipFeature(boolean useGzipFeature) {
|
|
||||||
this.useGzipFeature = useGzipFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseRuntimeException(boolean useRuntimeException) {
|
|
||||||
this.useRuntimeException = useRuntimeException;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseReflectionEqualsHashCode(boolean useReflectionEqualsHashCode) {
|
|
||||||
this.useReflectionEqualsHashCode = useReflectionEqualsHashCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
||||||
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUseAbstractionForFiles(boolean useAbstractionForFiles) {
|
|
||||||
this.useAbstractionForFiles = useAbstractionForFiles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDynamicOperations(final boolean dynamicOperations) {
|
|
||||||
this.dynamicOperations = dynamicOperations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportStreaming(final boolean supportStreaming) {
|
|
||||||
this.supportStreaming = supportStreaming;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWithAWSV4Signature(boolean withAWSV4Signature) {
|
|
||||||
this.withAWSV4Signature = withAWSV4Signature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGradleProperties(final String gradleProperties) {
|
|
||||||
this.gradleProperties = gradleProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setErrorObjectType(final String errorObjectType) {
|
|
||||||
this.errorObjectType = errorObjectType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGenerateClientAsBean(boolean generateClientAsBean) {
|
|
||||||
this.generateClientAsBean = generateClientAsBean;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseEnumCaseInsensitive(boolean useEnumCaseInsensitive) {
|
|
||||||
this.useEnumCaseInsensitive = useEnumCaseInsensitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaxAttemptsForRetry(int maxAttemptsForRetry) {
|
|
||||||
this.maxAttemptsForRetry = maxAttemptsForRetry;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWaitTimeMillis(long waitTimeMillis) {
|
|
||||||
this.waitTimeMillis = waitTimeMillis;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Serialization library.
|
|
||||||
*
|
|
||||||
* @return 'gson' or 'jackson'
|
|
||||||
*/
|
|
||||||
public String getSerializationLibrary() {
|
|
||||||
return serializationLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSerializationLibrary(String serializationLibrary) {
|
public void setSerializationLibrary(String serializationLibrary) {
|
||||||
if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {
|
if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {
|
||||||
this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
|
this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
|
||||||
@ -1331,10 +1235,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
|||||||
return super.postProcessSupportingFileData(objs);
|
return super.postProcessSupportingFileData(objs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setConfigKeyFromClassName(boolean configKeyFromClassName) {
|
|
||||||
this.configKeyFromClassName = configKeyFromClassName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toApiVarName(String name) {
|
public String toApiVarName(String name) {
|
||||||
String apiVarName = super.toApiVarName(name);
|
String apiVarName = super.toApiVarName(name);
|
||||||
|
@ -33,6 +33,8 @@ import java.util.TreeSet;
|
|||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openapitools.codegen.CliOption;
|
import org.openapitools.codegen.CliOption;
|
||||||
@ -65,14 +67,14 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen {
|
|||||||
private static final String X_HELIDON_IMPL_IMPORTS = "x-helidon-implImports";
|
private static final String X_HELIDON_IMPL_IMPORTS = "x-helidon-implImports";
|
||||||
public static final String CONFIG_KEY = "configKey";
|
public static final String CONFIG_KEY = "configKey";
|
||||||
|
|
||||||
protected String configKey = null;
|
@Setter protected String configKey = null;
|
||||||
protected boolean useBeanValidation = false;
|
@Setter protected boolean useBeanValidation = false;
|
||||||
protected boolean performBeanValidation = false;
|
@Setter protected boolean performBeanValidation = false;
|
||||||
protected boolean useGzipFeature = false;
|
@Setter protected boolean useGzipFeature = false;
|
||||||
protected boolean caseInsensitiveResponseHeaders = false;
|
protected boolean caseInsensitiveResponseHeaders = false;
|
||||||
protected Path invokerFolder;
|
protected Path invokerFolder;
|
||||||
protected Path apiFolder;
|
protected Path apiFolder;
|
||||||
protected String serializationLibrary = null;
|
@Getter protected String serializationLibrary = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for this generator. Uses the embedded template dir to find common templates
|
* Constructor for this generator. Uses the embedded template dir to find common templates
|
||||||
@ -460,30 +462,10 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen {
|
|||||||
return objs;
|
return objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigKey(String configKey) {
|
|
||||||
this.configKey = configKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseBeanValidation(boolean useBeanValidation) {
|
|
||||||
this.useBeanValidation = useBeanValidation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPerformBeanValidation(boolean performBeanValidation) {
|
|
||||||
this.performBeanValidation = performBeanValidation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseGzipFeature(boolean useGzipFeature) {
|
|
||||||
this.useGzipFeature = useGzipFeature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) {
|
||||||
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSerializationLibrary() {
|
|
||||||
return serializationLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSerializationLibrary(String serializationLibrary) {
|
public void setSerializationLibrary(String serializationLibrary) {
|
||||||
if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {
|
if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {
|
||||||
this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
|
this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
|
||||||
|
@ -29,6 +29,7 @@ import java.util.Map;
|
|||||||
import io.swagger.v3.oas.models.Operation;
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
|
import lombok.Getter;
|
||||||
import org.openapitools.codegen.CliOption;
|
import org.openapitools.codegen.CliOption;
|
||||||
import org.openapitools.codegen.CodegenConstants;
|
import org.openapitools.codegen.CodegenConstants;
|
||||||
import org.openapitools.codegen.CodegenModel;
|
import org.openapitools.codegen.CodegenModel;
|
||||||
@ -56,7 +57,7 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen {
|
|||||||
|
|
||||||
protected boolean useBeanValidation = true;
|
protected boolean useBeanValidation = true;
|
||||||
protected String implFolder = "src/main/java";
|
protected String implFolder = "src/main/java";
|
||||||
protected String serializationLibrary = null;
|
@Getter protected String serializationLibrary = null;
|
||||||
|
|
||||||
private boolean useAbstractClass = false;
|
private boolean useAbstractClass = false;
|
||||||
private boolean gradleProject = false;
|
private boolean gradleProject = false;
|
||||||
@ -385,10 +386,6 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen {
|
|||||||
throw new UnsupportedOperationException("Not implemented");
|
throw new UnsupportedOperationException("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSerializationLibrary() {
|
|
||||||
return serializationLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSerializationLibrary(String serializationLibrary) {
|
public void setSerializationLibrary(String serializationLibrary) {
|
||||||
if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {
|
if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {
|
||||||
this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
|
this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user