forked from loafle/openapi-generator-original
[Groovy] improve code parsing body/form params (#2879)
* [Groovy] improve code parsing body/form params * remove leading space * remove leading space
This commit is contained in:
parent
fdd08dc1f1
commit
6bffe4dbc7
@ -17,8 +17,6 @@ sidebar_label: groovy
|
|||||||
|groupId|groupId in generated pom.xml| |org.openapitools|
|
|groupId|groupId in generated pom.xml| |org.openapitools|
|
||||||
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-groovy|
|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-groovy|
|
||||||
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0|
|
||||||
|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|
|
||||||
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
|
|
||||||
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|
|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|
||||||
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|
||||||
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|
||||||
|
@ -4862,7 +4862,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
*
|
*
|
||||||
* @param objs map of object
|
* @param objs map of object
|
||||||
*/
|
*/
|
||||||
public void generateJSONSpecFile(Map<String, Object> objs) {
|
protected void generateJSONSpecFile(Map<String, Object> objs) {
|
||||||
OpenAPI openAPI = (OpenAPI) objs.get("openAPI");
|
OpenAPI openAPI = (OpenAPI) objs.get("openAPI");
|
||||||
if (openAPI != null) {
|
if (openAPI != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -652,19 +652,6 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code
|
|||||||
return escapeText(pattern);
|
return escapeText(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean convertPropertyToBoolean(String propertyKey) {
|
|
||||||
boolean booleanValue = false;
|
|
||||||
if (additionalProperties.containsKey(propertyKey)) {
|
|
||||||
booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return booleanValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void writePropertyBack(String propertyKey, boolean value) {
|
|
||||||
additionalProperties.put(propertyKey, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String sanitizeTag(String tag) {
|
public String sanitizeTag(String tag) {
|
||||||
return camelize(sanitizeName(tag));
|
return camelize(sanitizeName(tag));
|
||||||
|
@ -1060,7 +1060,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
String defaultContentType = "application/json";
|
String defaultContentType = "application/json";
|
||||||
Set<String> producesInfo = getProducesInfo(openAPI, operation);
|
Set<String> producesInfo = getProducesInfo(openAPI, operation);
|
||||||
if (producesInfo != null && !producesInfo.isEmpty()) {
|
if (producesInfo != null && !producesInfo.isEmpty()) {
|
||||||
ArrayList<String> produces = new ArrayList<String>(producesInfo);
|
ArrayList<String> produces = new ArrayList<>(producesInfo);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (String produce : produces) {
|
for (String produce : produces) {
|
||||||
if (defaultContentType.equalsIgnoreCase(produce)) {
|
if (defaultContentType.equalsIgnoreCase(produce)) {
|
||||||
@ -1085,7 +1085,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean needToImport(String type) {
|
protected boolean needToImport(String type) {
|
||||||
return super.needToImport(type) && type.indexOf(".") < 0;
|
return super.needToImport(type) && !type.contains(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1183,10 +1183,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
|
|
||||||
if (removedChildEnum) {
|
if (removedChildEnum) {
|
||||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||||
int count = 0, numVars = codegenProperties.size();
|
int count = 0;
|
||||||
|
int numVars = codegenProperties.size();
|
||||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||||
count += 1;
|
count += 1;
|
||||||
codegenProperty.hasMore = (count < numVars) ? true : false;
|
codegenProperty.hasMore = count < numVars;
|
||||||
}
|
}
|
||||||
codegenModel.vars = codegenProperties;
|
codegenModel.vars = codegenProperties;
|
||||||
}
|
}
|
||||||
@ -1444,27 +1445,13 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
return escapeText(pattern);
|
return escapeText(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean convertPropertyToBoolean(String propertyKey) {
|
|
||||||
boolean booleanValue = false;
|
|
||||||
if (additionalProperties.containsKey(propertyKey)) {
|
|
||||||
booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return booleanValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writePropertyBack(String propertyKey, boolean value) {
|
|
||||||
additionalProperties.put(propertyKey, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output the Getter name for boolean property, e.g. isActive
|
* Output the Getter name for boolean property, e.g. isActive
|
||||||
*
|
*
|
||||||
* @param name the name of the property
|
* @param name the name of the property
|
||||||
* @return getter name based on naming convention
|
* @return getter name based on naming convention
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toBooleanGetter(String name) {
|
public String toBooleanGetter(String name) {
|
||||||
return booleanGetterPrefix + getterAndSetterCapitalize(name);
|
return booleanGetterPrefix + getterAndSetterCapitalize(name);
|
||||||
}
|
}
|
||||||
@ -1505,7 +1492,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
|||||||
return camelize(name, lowercaseFirstLetter);
|
return camelize(name, lowercaseFirstLetter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postProcessFile(File file, String fileType) {
|
public void postProcessFile(File file, String fileType) {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
|
@ -56,13 +56,15 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
|
|||||||
artifactId = "openapi-groovy";
|
artifactId = "openapi-groovy";
|
||||||
dateLibrary = "legacy"; //TODO: add joda support to groovy
|
dateLibrary = "legacy"; //TODO: add joda support to groovy
|
||||||
|
|
||||||
// clioOptions default redefinition need to be updated
|
// cliOptions default redefinition need to be updated
|
||||||
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
|
updateOption(CodegenConstants.SOURCE_FOLDER, this.getSourceFolder());
|
||||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||||
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
||||||
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
|
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
|
||||||
updateOption(DATE_LIBRARY, this.getDateLibrary());
|
updateOption(DATE_LIBRARY, this.getDateLibrary());
|
||||||
|
removeOption(CodegenConstants.ARTIFACT_URL);
|
||||||
|
removeOption(CodegenConstants.ARTIFACT_DESCRIPTION);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +97,6 @@ public class GroovyClientCodegen extends AbstractJavaCodegen {
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> operations, List<Object> allModels) {
|
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> operations, List<Object> allModels) {
|
||||||
Map<String, Object> objs = (Map<String, Object>) operations.get("operations");
|
Map<String, Object> objs = (Map<String, Object>) operations.get("operations");
|
||||||
|
|
||||||
List<CodegenOperation> ops = (List<CodegenOperation>) objs.get("operation");
|
List<CodegenOperation> ops = (List<CodegenOperation>) objs.get("operation");
|
||||||
for (CodegenOperation op : ops) {
|
for (CodegenOperation op : ops) {
|
||||||
// Overwrite path to map variable with path parameters
|
// Overwrite path to map variable with path parameters
|
||||||
|
@ -54,7 +54,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
|||||||
apiPackage = "org.openapitools.api";
|
apiPackage = "org.openapitools.api";
|
||||||
modelPackage = "org.openapitools.model";
|
modelPackage = "org.openapitools.model";
|
||||||
|
|
||||||
// clioOptions default redifinition need to be updated
|
// cliOptions default redefinition need to be updated
|
||||||
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage());
|
||||||
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
|
||||||
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
|
||||||
@ -80,13 +80,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
|||||||
|
|
||||||
super.embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "spec";
|
super.embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "spec";
|
||||||
|
|
||||||
for (int i = 0; i < cliOptions.size(); i++) {
|
removeOption(CodegenConstants.LIBRARY);
|
||||||
if (CodegenConstants.LIBRARY.equals(cliOptions.get(i).getOpt())) {
|
|
||||||
cliOptions.remove(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_LIBRARY);
|
CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_LIBRARY);
|
||||||
Map<String, String> supportedLibraries = new LinkedHashMap<>();
|
Map<String, String> supportedLibraries = new LinkedHashMap<>();
|
||||||
supportedLibraries.put(DEFAULT_LIBRARY, "JAXRS");
|
supportedLibraries.put(DEFAULT_LIBRARY, "JAXRS");
|
||||||
|
@ -20,12 +20,14 @@ class {{classname}} {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
{{#allParams}}{{#required}}
|
{{#allParams}}
|
||||||
|
{{#required}}
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if ({{paramName}} == null) {
|
if ({{paramName}} == null) {
|
||||||
throw new RuntimeException("missing required params {{paramName}}")
|
throw new RuntimeException("missing required params {{paramName}}")
|
||||||
}
|
}
|
||||||
{{/required}}{{/allParams}}
|
{{/required}}
|
||||||
|
{{/allParams}}
|
||||||
|
|
||||||
{{#queryParams}}
|
{{#queryParams}}
|
||||||
if ({{paramName}} != null) {
|
if ({{paramName}} != null) {
|
||||||
@ -47,15 +49,19 @@ class {{classname}} {
|
|||||||
contentType = '{{{mediaType}}}';
|
contentType = '{{{mediaType}}}';
|
||||||
{{/consumes.0}}
|
{{/consumes.0}}
|
||||||
{{/bodyParam}}
|
{{/bodyParam}}
|
||||||
{{#bodyParams}}
|
{{#bodyParams.0}}
|
||||||
// only one body parameter
|
{{^hasMore}}
|
||||||
if (1 == {{bodyParams.size}}) {
|
|
||||||
bodyParams = {{paramName}}
|
bodyParams = {{paramName}}
|
||||||
}
|
{{/hasMore}}
|
||||||
// array of body parameters
|
{{#hasMore}}
|
||||||
else {
|
bodyParams = [:]
|
||||||
bodyParams.put("{{baseName}}", {{paramName}})
|
bodyParams.put("{{baseName}}", {{paramName}})
|
||||||
}
|
{{/hasMore}}
|
||||||
|
{{/bodyParams.0}}
|
||||||
|
{{#bodyParams}}
|
||||||
|
{{#secondaryParam}}
|
||||||
|
bodyParams.put("{{baseName}}", {{paramName}})
|
||||||
|
{{/secondaryParam}}
|
||||||
{{/bodyParams}}
|
{{/bodyParams}}
|
||||||
|
|
||||||
{{#hasFormParams}}
|
{{#hasFormParams}}
|
||||||
@ -63,20 +69,18 @@ class {{classname}} {
|
|||||||
contentType = '{{{mediaType}}}';
|
contentType = '{{{mediaType}}}';
|
||||||
{{/consumes.0}}
|
{{/consumes.0}}
|
||||||
{{#formParams.0}}
|
{{#formParams.0}}
|
||||||
// only one form parameter
|
{{^hasMore}}
|
||||||
if (1 == {{formParams.size}}) {
|
|
||||||
bodyParams = {{paramName}}
|
bodyParams = {{paramName}}
|
||||||
}
|
{{/hasMore}}
|
||||||
// array of form parameters
|
{{#hasMore}}
|
||||||
else {
|
|
||||||
bodyParams = [:]
|
bodyParams = [:]
|
||||||
}
|
bodyParams.put("{{baseName}}", {{paramName}})
|
||||||
|
{{/hasMore}}
|
||||||
{{/formParams.0}}
|
{{/formParams.0}}
|
||||||
{{#formParams}}
|
{{#formParams}}
|
||||||
// array of form parameters
|
{{#secondaryParam}}
|
||||||
if (1 < {{formParams.size}}) {
|
|
||||||
bodyParams.put("{{baseName}}", {{paramName}})
|
bodyParams.put("{{baseName}}", {{paramName}})
|
||||||
}
|
{{/secondaryParam}}
|
||||||
{{/formParams}}
|
{{/formParams}}
|
||||||
{{/hasFormParams}}
|
{{/hasFormParams}}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
throw new RuntimeException("missing required params body")
|
throw new RuntimeException("missing required params body")
|
||||||
@ -26,16 +25,8 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/json';
|
contentType = 'application/json';
|
||||||
// only one body parameter
|
|
||||||
if (1 == 1) {
|
|
||||||
bodyParams = body
|
bodyParams = body
|
||||||
}
|
|
||||||
// array of body parameters
|
|
||||||
else {
|
|
||||||
bodyParams.put("body", body)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
@ -53,14 +44,12 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
throw new RuntimeException("missing required params petId")
|
throw new RuntimeException("missing required params petId")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (apiKey != null) {
|
if (apiKey != null) {
|
||||||
headerParams.put("api_key", apiKey)
|
headerParams.put("api_key", apiKey)
|
||||||
}
|
}
|
||||||
@ -82,13 +71,11 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
throw new RuntimeException("missing required params status")
|
throw new RuntimeException("missing required params status")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
queryParams.put("status", status)
|
queryParams.put("status", status)
|
||||||
}
|
}
|
||||||
@ -111,13 +98,11 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (tags == null) {
|
if (tags == null) {
|
||||||
throw new RuntimeException("missing required params tags")
|
throw new RuntimeException("missing required params tags")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (tags != null) {
|
if (tags != null) {
|
||||||
queryParams.put("tags", tags)
|
queryParams.put("tags", tags)
|
||||||
}
|
}
|
||||||
@ -140,7 +125,6 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
throw new RuntimeException("missing required params petId")
|
throw new RuntimeException("missing required params petId")
|
||||||
@ -150,7 +134,6 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"GET", "",
|
"GET", "",
|
||||||
Pet.class )
|
Pet.class )
|
||||||
@ -166,7 +149,6 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
throw new RuntimeException("missing required params body")
|
throw new RuntimeException("missing required params body")
|
||||||
@ -174,16 +156,8 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/json';
|
contentType = 'application/json';
|
||||||
// only one body parameter
|
|
||||||
if (1 == 1) {
|
|
||||||
bodyParams = body
|
bodyParams = body
|
||||||
}
|
|
||||||
// array of body parameters
|
|
||||||
else {
|
|
||||||
bodyParams.put("body", body)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
@ -201,7 +175,6 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
throw new RuntimeException("missing required params petId")
|
throw new RuntimeException("missing required params petId")
|
||||||
@ -210,24 +183,10 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/x-www-form-urlencoded';
|
contentType = 'application/x-www-form-urlencoded';
|
||||||
// only one form parameter
|
|
||||||
if (1 == 2) {
|
|
||||||
bodyParams = name
|
|
||||||
}
|
|
||||||
// array of form parameters
|
|
||||||
else {
|
|
||||||
bodyParams = [:]
|
bodyParams = [:]
|
||||||
}
|
|
||||||
// array of form parameters
|
|
||||||
if (1 < 2) {
|
|
||||||
bodyParams.put("name", name)
|
bodyParams.put("name", name)
|
||||||
}
|
|
||||||
// array of form parameters
|
|
||||||
if (1 < 2) {
|
|
||||||
bodyParams.put("status", status)
|
bodyParams.put("status", status)
|
||||||
}
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"POST", "",
|
"POST", "",
|
||||||
@ -244,7 +203,6 @@ class PetApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (petId == null) {
|
if (petId == null) {
|
||||||
throw new RuntimeException("missing required params petId")
|
throw new RuntimeException("missing required params petId")
|
||||||
@ -253,24 +211,10 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'multipart/form-data';
|
contentType = 'multipart/form-data';
|
||||||
// only one form parameter
|
|
||||||
if (1 == 2) {
|
|
||||||
bodyParams = additionalMetadata
|
|
||||||
}
|
|
||||||
// array of form parameters
|
|
||||||
else {
|
|
||||||
bodyParams = [:]
|
bodyParams = [:]
|
||||||
}
|
|
||||||
// array of form parameters
|
|
||||||
if (1 < 2) {
|
|
||||||
bodyParams.put("additionalMetadata", additionalMetadata)
|
bodyParams.put("additionalMetadata", additionalMetadata)
|
||||||
}
|
|
||||||
// array of form parameters
|
|
||||||
if (1 < 2) {
|
|
||||||
bodyParams.put("file", file)
|
bodyParams.put("file", file)
|
||||||
}
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"POST", "",
|
"POST", "",
|
||||||
|
@ -17,7 +17,6 @@ class StoreApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
throw new RuntimeException("missing required params orderId")
|
throw new RuntimeException("missing required params orderId")
|
||||||
@ -27,7 +26,6 @@ class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"DELETE", "",
|
"DELETE", "",
|
||||||
null )
|
null )
|
||||||
@ -48,7 +46,6 @@ class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"GET", "map",
|
"GET", "map",
|
||||||
Integer.class )
|
Integer.class )
|
||||||
@ -64,7 +61,6 @@ class StoreApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (orderId == null) {
|
if (orderId == null) {
|
||||||
throw new RuntimeException("missing required params orderId")
|
throw new RuntimeException("missing required params orderId")
|
||||||
@ -74,7 +70,6 @@ class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"GET", "",
|
"GET", "",
|
||||||
Order.class )
|
Order.class )
|
||||||
@ -90,7 +85,6 @@ class StoreApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
throw new RuntimeException("missing required params body")
|
throw new RuntimeException("missing required params body")
|
||||||
@ -98,16 +92,8 @@ class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/json';
|
contentType = 'application/json';
|
||||||
// only one body parameter
|
|
||||||
if (1 == 1) {
|
|
||||||
bodyParams = body
|
bodyParams = body
|
||||||
}
|
|
||||||
// array of body parameters
|
|
||||||
else {
|
|
||||||
bodyParams.put("body", body)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
|
@ -18,7 +18,6 @@ class UserApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
throw new RuntimeException("missing required params body")
|
throw new RuntimeException("missing required params body")
|
||||||
@ -26,16 +25,8 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/json';
|
contentType = 'application/json';
|
||||||
// only one body parameter
|
|
||||||
if (1 == 1) {
|
|
||||||
bodyParams = body
|
bodyParams = body
|
||||||
}
|
|
||||||
// array of body parameters
|
|
||||||
else {
|
|
||||||
bodyParams.put("body", body)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
@ -53,7 +44,6 @@ class UserApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
throw new RuntimeException("missing required params body")
|
throw new RuntimeException("missing required params body")
|
||||||
@ -61,16 +51,8 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/json';
|
contentType = 'application/json';
|
||||||
// only one body parameter
|
|
||||||
if (1 == 1) {
|
|
||||||
bodyParams = body
|
bodyParams = body
|
||||||
}
|
|
||||||
// array of body parameters
|
|
||||||
else {
|
|
||||||
bodyParams.put("body", body)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
@ -88,7 +70,6 @@ class UserApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
throw new RuntimeException("missing required params body")
|
throw new RuntimeException("missing required params body")
|
||||||
@ -96,16 +77,8 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/json';
|
contentType = 'application/json';
|
||||||
// only one body parameter
|
|
||||||
if (1 == 1) {
|
|
||||||
bodyParams = body
|
bodyParams = body
|
||||||
}
|
|
||||||
// array of body parameters
|
|
||||||
else {
|
|
||||||
bodyParams.put("body", body)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
@ -123,7 +96,6 @@ class UserApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
throw new RuntimeException("missing required params username")
|
throw new RuntimeException("missing required params username")
|
||||||
@ -133,7 +105,6 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"DELETE", "",
|
"DELETE", "",
|
||||||
null )
|
null )
|
||||||
@ -149,7 +120,6 @@ class UserApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
throw new RuntimeException("missing required params username")
|
throw new RuntimeException("missing required params username")
|
||||||
@ -159,7 +129,6 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"GET", "",
|
"GET", "",
|
||||||
User.class )
|
User.class )
|
||||||
@ -175,18 +144,15 @@ class UserApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
throw new RuntimeException("missing required params username")
|
throw new RuntimeException("missing required params username")
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (password == null) {
|
if (password == null) {
|
||||||
throw new RuntimeException("missing required params password")
|
throw new RuntimeException("missing required params password")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (username != null) {
|
if (username != null) {
|
||||||
queryParams.put("username", username)
|
queryParams.put("username", username)
|
||||||
}
|
}
|
||||||
@ -217,7 +183,6 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
"GET", "",
|
"GET", "",
|
||||||
null )
|
null )
|
||||||
@ -233,12 +198,10 @@ class UserApi {
|
|||||||
def bodyParams
|
def bodyParams
|
||||||
def contentType
|
def contentType
|
||||||
|
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
throw new RuntimeException("missing required params username")
|
throw new RuntimeException("missing required params username")
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify required params are set
|
// verify required params are set
|
||||||
if (body == null) {
|
if (body == null) {
|
||||||
throw new RuntimeException("missing required params body")
|
throw new RuntimeException("missing required params body")
|
||||||
@ -246,16 +209,8 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
contentType = 'application/json';
|
contentType = 'application/json';
|
||||||
// only one body parameter
|
|
||||||
if (1 == 1) {
|
|
||||||
bodyParams = body
|
bodyParams = body
|
||||||
}
|
|
||||||
// array of body parameters
|
|
||||||
else {
|
|
||||||
bodyParams.put("body", body)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user