mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 22:50:53 +00:00
Removes secondaryParam and hasMore (#7882)
* Removes secondaryParam and hasMore * Fixes tests * Only uses bodyParam in groovy template
This commit is contained in:
parent
05515040d5
commit
08fb59009a
@ -264,7 +264,7 @@ Method | HTTP request | Description
|
||||
{{#operation}}
|
||||
<a name="{{operationId}}"></a>
|
||||
# **{{operationId}}**
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
|
||||
|
||||
{{summary}}{{#notes}}
|
||||
|
||||
@ -287,8 +287,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
|
@ -173,7 +173,7 @@ index 49b17c7..16ee191 100644
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
+ @Loggable(Loggable.INFO)
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}};
|
||||
{{#allParams}}{{#required}}
|
||||
|
||||
@ -610,9 +610,7 @@ A `Pet` model with three properties will provide a _lot_ of information about th
|
||||
"jsonSchema" : "{\n \"type\" : \"integer\",\n \"format\" : \"int64\"\n}",
|
||||
"exclusiveMinimum" : false,
|
||||
"exclusiveMaximum" : false,
|
||||
"hasMore" : true,
|
||||
"required" : true,
|
||||
"secondaryParam" : false,
|
||||
"hasMoreNonReadOnly" : true,
|
||||
"isPrimitiveType" : true,
|
||||
"isModel" : false,
|
||||
@ -662,9 +660,7 @@ A `Pet` model with three properties will provide a _lot_ of information about th
|
||||
"jsonSchema" : "{\n \"type\" : \"string\"\n}",
|
||||
"exclusiveMinimum" : false,
|
||||
"exclusiveMaximum" : false,
|
||||
"hasMore" : true,
|
||||
"required" : true,
|
||||
"secondaryParam" : false,
|
||||
"hasMoreNonReadOnly" : true,
|
||||
"isPrimitiveType" : true,
|
||||
"isModel" : false,
|
||||
@ -714,9 +710,7 @@ A `Pet` model with three properties will provide a _lot_ of information about th
|
||||
"jsonSchema" : "{\n \"type\" : \"string\"\n}",
|
||||
"exclusiveMinimum" : false,
|
||||
"exclusiveMaximum" : false,
|
||||
"hasMore" : false,
|
||||
"required" : false,
|
||||
"secondaryParam" : false,
|
||||
"hasMoreNonReadOnly" : false,
|
||||
"isPrimitiveType" : true,
|
||||
"isModel" : false,
|
||||
@ -954,10 +948,8 @@ definitions:
|
||||
colDataTypeArguments:
|
||||
- argumentValue: 16
|
||||
isString: false
|
||||
hasMore: true
|
||||
- argumentValue: 4
|
||||
isString: false
|
||||
hasMore: false
|
||||
colUnsigned: true
|
||||
colNotNull: true
|
||||
colDefault:
|
||||
|
@ -21,13 +21,11 @@ import java.util.*;
|
||||
|
||||
public class CodegenCallback {
|
||||
public String name;
|
||||
public boolean hasMore;
|
||||
public List<Url> urls = new ArrayList<>();
|
||||
public Map<String, Object> vendorExtensions = new HashMap<>();
|
||||
|
||||
public static class Url {
|
||||
public String expression;
|
||||
public boolean hasMore;
|
||||
public List<CodegenOperation> requests = new ArrayList<>();
|
||||
public Map<String, Object> vendorExtensions = new HashMap<>();
|
||||
|
||||
@ -37,12 +35,12 @@ public class CodegenCallback {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Url that = (Url) o;
|
||||
return Objects.equals(that.expression, expression) && Objects.equals(that.hasMore, hasMore) &&
|
||||
return Objects.equals(that.expression, expression) &&
|
||||
Objects.equals(that.requests, requests) && Objects.equals(that.vendorExtensions, vendorExtensions);
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(expression, hasMore, requests, vendorExtensions);
|
||||
return Objects.hash(expression, requests, vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -62,13 +60,13 @@ public class CodegenCallback {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
CodegenCallback that = (CodegenCallback) o;
|
||||
return Objects.equals(that.name, name) && Objects.equals(that.hasMore, hasMore) &&
|
||||
return Objects.equals(that.name, name) &&
|
||||
Objects.equals(that.urls, urls) && Objects.equals(that.vendorExtensions, vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, hasMore, urls, vendorExtensions);
|
||||
return Objects.hash(name, urls, vendorExtensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -909,7 +909,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove duplicated properties in all variable list and update "hasMore"
|
||||
* Remove duplicated properties in all variable list
|
||||
*/
|
||||
public void removeAllDuplicatedProperty() {
|
||||
// remove duplicated properties
|
||||
@ -920,15 +920,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
allVars = removeDuplicatedProperty(allVars);
|
||||
readOnlyVars = removeDuplicatedProperty(readOnlyVars);
|
||||
readWriteVars = removeDuplicatedProperty(readWriteVars);
|
||||
|
||||
// update property list's "hasMore"
|
||||
updatePropertyListHasMore(vars);
|
||||
updatePropertyListHasMore(optionalVars);
|
||||
updatePropertyListHasMore(requiredVars);
|
||||
updatePropertyListHasMore(parentVars);
|
||||
updatePropertyListHasMore(allVars);
|
||||
updatePropertyListHasMore(readOnlyVars);
|
||||
updatePropertyListHasMore(readWriteVars);
|
||||
}
|
||||
|
||||
private List<CodegenProperty> removeDuplicatedProperty(List<CodegenProperty> vars) {
|
||||
@ -956,21 +947,6 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
||||
return newList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone the element and update "hasMore" in the list of codegen properties
|
||||
*/
|
||||
private void updatePropertyListHasMore(List<CodegenProperty> vars) {
|
||||
if (vars != null) {
|
||||
for (int i = 0; i < vars.size(); i++) {
|
||||
if (i < vars.size() - 1) {
|
||||
vars.get(i).hasMore = true;
|
||||
} else { // last element
|
||||
vars.get(i).hasMore = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove self reference import
|
||||
*/
|
||||
|
@ -26,7 +26,7 @@ public class CodegenOperation {
|
||||
public final List<CodegenProperty> responseHeaders = new ArrayList<CodegenProperty>();
|
||||
public boolean hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams, hasRequiredParams,
|
||||
returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
|
||||
isArray, isMultipart, hasMore = true,
|
||||
isArray, isMultipart,
|
||||
isResponseBinary = false, isResponseFile = false, hasReference = false,
|
||||
isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
|
||||
isRestful, isDeprecated, isCallbackRequest, uniqueItems;
|
||||
@ -258,7 +258,6 @@ public class CodegenOperation {
|
||||
sb.append(", isMap=").append(isMap);
|
||||
sb.append(", isArray=").append(isArray);
|
||||
sb.append(", isMultipart=").append(isMultipart);
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", isResponseBinary=").append(isResponseBinary);
|
||||
sb.append(", isResponseFile=").append(isResponseFile);
|
||||
sb.append(", hasReference=").append(hasReference);
|
||||
@ -332,7 +331,6 @@ public class CodegenOperation {
|
||||
isMap == that.isMap &&
|
||||
isArray == that.isArray &&
|
||||
isMultipart == that.isMultipart &&
|
||||
hasMore == that.hasMore &&
|
||||
isResponseBinary == that.isResponseBinary &&
|
||||
isResponseFile == that.isResponseFile &&
|
||||
hasReference == that.hasReference &&
|
||||
@ -393,7 +391,7 @@ public class CodegenOperation {
|
||||
|
||||
return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams,
|
||||
hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
|
||||
isArray, isMultipart, hasMore, isResponseBinary, isResponseFile, hasReference, isRestfulIndex,
|
||||
isArray, isMultipart, isResponseBinary, isResponseFile, hasReference, isRestfulIndex,
|
||||
isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, isRestful, isDeprecated,
|
||||
isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod, returnBaseType,
|
||||
returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse, discriminator, consumes,
|
||||
|
@ -26,8 +26,8 @@ import java.util.*;
|
||||
*/
|
||||
public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
|
||||
isCookieParam, isBodyParam, hasMore, isContainer,
|
||||
secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode;
|
||||
isCookieParam, isBodyParam, isContainer,
|
||||
isCollectionFormatMulti, isPrimitiveType, isModel, isExplode;
|
||||
public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType,
|
||||
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style;
|
||||
|
||||
@ -105,9 +105,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
public CodegenParameter copy() {
|
||||
CodegenParameter output = new CodegenParameter();
|
||||
output.isFile = this.isFile;
|
||||
output.hasMore = this.hasMore;
|
||||
output.isContainer = this.isContainer;
|
||||
output.secondaryParam = this.secondaryParam;
|
||||
output.baseName = this.baseName;
|
||||
output.paramName = this.paramName;
|
||||
output.dataType = this.dataType;
|
||||
@ -202,7 +200,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore, isContainer, secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf);
|
||||
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -216,9 +214,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
isHeaderParam == that.isHeaderParam &&
|
||||
isCookieParam == that.isCookieParam &&
|
||||
isBodyParam == that.isBodyParam &&
|
||||
hasMore == that.hasMore &&
|
||||
isContainer == that.isContainer &&
|
||||
secondaryParam == that.secondaryParam &&
|
||||
isCollectionFormatMulti == that.isCollectionFormatMulti &&
|
||||
isPrimitiveType == that.isPrimitiveType &&
|
||||
isModel == that.isModel &&
|
||||
@ -295,9 +291,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
sb.append(", isHeaderParam=").append(isHeaderParam);
|
||||
sb.append(", isCookieParam=").append(isCookieParam);
|
||||
sb.append(", isBodyParam=").append(isBodyParam);
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", isContainer=").append(isContainer);
|
||||
sb.append(", secondaryParam=").append(secondaryParam);
|
||||
sb.append(", isCollectionFormatMulti=").append(isCollectionFormatMulti);
|
||||
sb.append(", isPrimitiveType=").append(isPrimitiveType);
|
||||
sb.append(", isModel=").append(isModel);
|
||||
|
@ -103,10 +103,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
* The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance.
|
||||
*/
|
||||
public boolean exclusiveMaximum;
|
||||
public boolean hasMore;
|
||||
public boolean required;
|
||||
public boolean deprecated;
|
||||
public boolean secondaryParam;
|
||||
public boolean hasMoreNonReadOnly; // for model constructor, true if next property is not readonly
|
||||
public boolean isPrimitiveType;
|
||||
public boolean isModel;
|
||||
@ -431,14 +429,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
this.required = required;
|
||||
}
|
||||
|
||||
public boolean getSecondaryParam() {
|
||||
return secondaryParam;
|
||||
}
|
||||
|
||||
public void setSecondaryParam(boolean secondaryParam) {
|
||||
this.secondaryParam = secondaryParam;
|
||||
}
|
||||
|
||||
public List<String> get_enum() {
|
||||
return _enum;
|
||||
}
|
||||
@ -716,10 +706,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
sb.append(", maximum='").append(maximum).append('\'');
|
||||
sb.append(", exclusiveMinimum=").append(exclusiveMinimum);
|
||||
sb.append(", exclusiveMaximum=").append(exclusiveMaximum);
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", required=").append(required);
|
||||
sb.append(", deprecated=").append(deprecated);
|
||||
sb.append(", secondaryParam=").append(secondaryParam);
|
||||
sb.append(", hasMoreNonReadOnly=").append(hasMoreNonReadOnly);
|
||||
sb.append(", isPrimitiveType=").append(isPrimitiveType);
|
||||
sb.append(", isModel=").append(isModel);
|
||||
@ -787,10 +775,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
CodegenProperty that = (CodegenProperty) o;
|
||||
return exclusiveMinimum == that.exclusiveMinimum &&
|
||||
exclusiveMaximum == that.exclusiveMaximum &&
|
||||
hasMore == that.hasMore &&
|
||||
required == that.required &&
|
||||
deprecated == that.deprecated &&
|
||||
secondaryParam == that.secondaryParam &&
|
||||
hasMoreNonReadOnly == that.hasMoreNonReadOnly &&
|
||||
isPrimitiveType == that.isPrimitiveType &&
|
||||
isModel == that.isModel &&
|
||||
@ -878,7 +864,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
dataType, datatypeWithEnum, dataFormat, name, min, max, defaultValue,
|
||||
defaultValueWithParam, baseType, containerType, title, unescapedDescription,
|
||||
maxLength, minLength, pattern, example, jsonSchema, minimum, maximum,
|
||||
exclusiveMinimum, exclusiveMaximum, hasMore, required, deprecated, secondaryParam,
|
||||
exclusiveMinimum, exclusiveMaximum, required, deprecated,
|
||||
hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric,
|
||||
isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isFile,
|
||||
isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject,
|
||||
|
@ -28,7 +28,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
public boolean is4xx;
|
||||
public boolean is5xx;
|
||||
public String message;
|
||||
public boolean hasMore;
|
||||
public List<Map<String, Object>> examples;
|
||||
public String dataType;
|
||||
public String baseType;
|
||||
@ -81,7 +80,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, hasHeaders,
|
||||
return Objects.hash(headers, code, message, examples, dataType, baseType, containerType, hasHeaders,
|
||||
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate,
|
||||
isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType,
|
||||
isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties,
|
||||
@ -95,8 +94,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof CodegenResponse)) return false;
|
||||
CodegenResponse that = (CodegenResponse) o;
|
||||
return hasMore == that.hasMore &&
|
||||
hasHeaders == that.hasHeaders &&
|
||||
return hasHeaders == that.hasHeaders &&
|
||||
isString == that.isString &&
|
||||
isNumeric == that.isNumeric &&
|
||||
isInteger == that.isInteger &&
|
||||
@ -365,7 +363,6 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
sb.append("headers=").append(headers);
|
||||
sb.append(", code='").append(code).append('\'');
|
||||
sb.append(", message='").append(message).append('\'');
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", examples=").append(examples);
|
||||
sb.append(", dataType='").append(dataType).append('\'');
|
||||
sb.append(", baseType='").append(baseType).append('\'');
|
||||
|
@ -28,7 +28,7 @@ public class CodegenSecurity {
|
||||
public String name;
|
||||
public String type;
|
||||
public String scheme;
|
||||
public Boolean hasMore, isBasic, isOAuth, isApiKey;
|
||||
public Boolean isBasic, isOAuth, isApiKey;
|
||||
// is Basic is true for all http authentication type.
|
||||
// Those are to differentiate basic and bearer authentication
|
||||
// isHttpSignature is to support HTTP signature authorization scheme.
|
||||
@ -50,7 +50,6 @@ public class CodegenSecurity {
|
||||
// Copy all fields except the scopes.
|
||||
filteredSecurity.name = name;
|
||||
filteredSecurity.type = type;
|
||||
filteredSecurity.hasMore = false;
|
||||
filteredSecurity.isBasic = isBasic;
|
||||
filteredSecurity.isBasicBasic = isBasicBasic;
|
||||
filteredSecurity.isHttpSignature = isHttpSignature;
|
||||
@ -96,7 +95,6 @@ public class CodegenSecurity {
|
||||
return Objects.equals(name, that.name) &&
|
||||
Objects.equals(type, that.type) &&
|
||||
Objects.equals(scheme, that.scheme) &&
|
||||
Objects.equals(hasMore, that.hasMore) &&
|
||||
Objects.equals(isBasic, that.isBasic) &&
|
||||
Objects.equals(isOAuth, that.isOAuth) &&
|
||||
Objects.equals(isApiKey, that.isApiKey) &&
|
||||
@ -122,7 +120,7 @@ public class CodegenSecurity {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey,
|
||||
return Objects.hash(name, type, scheme, isBasic, isOAuth, isApiKey,
|
||||
isBasicBasic, isHttpSignature, isBasicBearer, bearerFormat, vendorExtensions,
|
||||
keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow,
|
||||
authorizationUrl, tokenUrl, scopes, isCode, isPassword, isApplication, isImplicit);
|
||||
@ -134,7 +132,6 @@ public class CodegenSecurity {
|
||||
sb.append("name='").append(name).append('\'');
|
||||
sb.append(", type='").append(type).append('\'');
|
||||
sb.append(", scheme='").append(scheme).append('\'');
|
||||
sb.append(", hasMore=").append(hasMore);
|
||||
sb.append(", isBasic=").append(isBasic);
|
||||
sb.append(", isOAuth=").append(isOAuth);
|
||||
sb.append(", isApiKey=").append(isApiKey);
|
||||
|
@ -3728,7 +3728,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
ApiResponse response = operation.getResponses().get(key);
|
||||
addProducesInfo(response, op);
|
||||
CodegenResponse r = fromResponse(key, response);
|
||||
r.hasMore = true;
|
||||
if (r.baseType != null &&
|
||||
!defaultIncludes.contains(r.baseType) &&
|
||||
!languageSpecificPrimitives.contains(r.baseType)) {
|
||||
@ -3752,7 +3751,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
int bDefault = "0".equals(b.code) ? 1 : 0;
|
||||
return aDefault - bDefault;
|
||||
});
|
||||
op.responses.get(op.responses.size() - 1).hasMore = false;
|
||||
|
||||
if (methodResponse != null) {
|
||||
handleMethodResponse(operation, schemas, op, methodResponse, importMapping);
|
||||
@ -3762,10 +3760,8 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (operation.getCallbacks() != null && !operation.getCallbacks().isEmpty()) {
|
||||
operation.getCallbacks().forEach((name, callback) -> {
|
||||
CodegenCallback c = fromCallback(name, callback, servers);
|
||||
c.hasMore = true;
|
||||
op.callbacks.add(c);
|
||||
});
|
||||
op.callbacks.get(op.callbacks.size() - 1).hasMore = false;
|
||||
}
|
||||
|
||||
List<Parameter> parameters = operation.getParameters();
|
||||
@ -3903,15 +3899,15 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
});
|
||||
}
|
||||
|
||||
op.allParams = addHasMore(allParams);
|
||||
op.bodyParams = addHasMore(bodyParams);
|
||||
op.pathParams = addHasMore(pathParams);
|
||||
op.queryParams = addHasMore(queryParams);
|
||||
op.headerParams = addHasMore(headerParams);
|
||||
op.cookieParams = addHasMore(cookieParams);
|
||||
op.formParams = addHasMore(formParams);
|
||||
op.requiredParams = addHasMore(requiredParams);
|
||||
op.optionalParams = addHasMore(optionalParams);
|
||||
op.allParams = allParams;
|
||||
op.bodyParams = bodyParams;
|
||||
op.pathParams = pathParams;
|
||||
op.queryParams = queryParams;
|
||||
op.headerParams = headerParams;
|
||||
op.cookieParams = cookieParams;
|
||||
op.formParams = formParams;
|
||||
op.requiredParams = requiredParams;
|
||||
op.optionalParams = optionalParams;
|
||||
op.externalDocs = operation.getExternalDocs();
|
||||
// legacy support
|
||||
op.nickname = op.operationId;
|
||||
@ -4135,7 +4131,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
callback.forEach((expression, pi) -> {
|
||||
CodegenCallback.Url u = new CodegenCallback.Url();
|
||||
u.expression = expression;
|
||||
u.hasMore = true;
|
||||
|
||||
if (pi.getExtensions() != null && !pi.getExtensions().isEmpty()) {
|
||||
u.vendorExtensions.putAll(pi.getExtensions());
|
||||
@ -4175,16 +4170,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
u.requests.add(co);
|
||||
});
|
||||
|
||||
if (!u.requests.isEmpty()) {
|
||||
u.requests.get(u.requests.size() - 1).hasMore = false;
|
||||
}
|
||||
c.urls.add(u);
|
||||
});
|
||||
|
||||
if (!c.urls.isEmpty()) {
|
||||
c.urls.get(c.urls.size() - 1).hasMore = false;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -4546,12 +4534,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
return ObjectUtils.compare(one.name, another.name);
|
||||
}
|
||||
});
|
||||
// set 'hasMore'
|
||||
Iterator<CodegenSecurity> it = codegenSecurities.iterator();
|
||||
while (it.hasNext()) {
|
||||
final CodegenSecurity security = it.next();
|
||||
security.hasMore = it.hasNext();
|
||||
}
|
||||
|
||||
return codegenSecurities;
|
||||
}
|
||||
@ -4684,20 +4666,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
}
|
||||
|
||||
private static List<CodegenParameter> addHasMore(List<CodegenParameter> objs) {
|
||||
if (objs != null) {
|
||||
for (int i = 0; i < objs.size(); i++) {
|
||||
if (i > 0) {
|
||||
objs.get(i).secondaryParam = true;
|
||||
}
|
||||
if (i < objs.size() - 1) {
|
||||
objs.get(i).hasMore = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return objs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add operation to group
|
||||
*
|
||||
@ -5614,14 +5582,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
Map<String, Object> scope = new HashMap<>();
|
||||
scope.put("scope", scopeEntry.getKey());
|
||||
scope.put("description", escapeText(scopeEntry.getValue()));
|
||||
|
||||
count += 1;
|
||||
if (count < numScopes) {
|
||||
scope.put("hasMore", "true");
|
||||
} else {
|
||||
scope.put("hasMore", null);
|
||||
}
|
||||
|
||||
scopes.add(scope);
|
||||
}
|
||||
codegenSecurity.scopes = scopes;
|
||||
@ -5645,14 +5605,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else {
|
||||
mediaType.put("mediaType", escapeText(escapeQuotationMark(key)));
|
||||
}
|
||||
|
||||
count += 1;
|
||||
if (count < consumes.size()) {
|
||||
mediaType.put("hasMore", "true");
|
||||
} else {
|
||||
mediaType.put("hasMore", null);
|
||||
}
|
||||
|
||||
mediaTypeList.add(mediaType);
|
||||
}
|
||||
|
||||
@ -5723,19 +5675,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
if (!existingMediaTypes.contains(encodedKey)) {
|
||||
Map<String, String> mediaType = new HashMap<String, String>();
|
||||
mediaType.put("mediaType", encodedKey);
|
||||
|
||||
count += 1;
|
||||
if (count < produces.size()) {
|
||||
mediaType.put("hasMore", "true");
|
||||
} else {
|
||||
mediaType.put("hasMore", null);
|
||||
}
|
||||
|
||||
if (!codegenOperation.produces.isEmpty()) {
|
||||
final Map<String, String> lastMediaType = codegenOperation.produces.get(codegenOperation.produces.size() - 1);
|
||||
lastMediaType.put("hasMore", "true");
|
||||
}
|
||||
|
||||
codegenOperation.produces.add(mediaType);
|
||||
codegenOperation.hasProduces = Boolean.TRUE;
|
||||
}
|
||||
|
@ -627,12 +627,6 @@ public class DefaultGenerator implements Generator {
|
||||
*/
|
||||
|
||||
allOperations.add(new HashMap<>(operation));
|
||||
for (int i = 0; i < allOperations.size(); i++) {
|
||||
Map<String, Object> oo = (Map<String, Object>) allOperations.get(i);
|
||||
if (i < (allOperations.size() - 1)) {
|
||||
oo.put("hasMore", "true");
|
||||
}
|
||||
}
|
||||
|
||||
for (String templateName : config.apiTemplateFiles().keySet()) {
|
||||
String filename = config.apiFilename(templateName, tag);
|
||||
@ -1193,14 +1187,6 @@ public class DefaultGenerator implements Generator {
|
||||
}
|
||||
|
||||
config.postProcessOperationsWithModels(operations, allModels);
|
||||
if (objs.size() > 0) {
|
||||
List<CodegenOperation> os = (List<CodegenOperation>) objs.get("operation");
|
||||
|
||||
if (os != null && os.size() > 0) {
|
||||
CodegenOperation op = os.get(os.size() - 1);
|
||||
op.hasMore = false;
|
||||
}
|
||||
}
|
||||
return operations;
|
||||
}
|
||||
|
||||
@ -1390,7 +1376,6 @@ public class DefaultGenerator implements Generator {
|
||||
// We have to create a new auth method instance because the original object must
|
||||
// not be modified.
|
||||
CodegenSecurity opSecurity = security.filterByScopeNames(opScopes);
|
||||
opSecurity.hasMore = security.hasMore;
|
||||
result.add(opSecurity);
|
||||
filtered = true;
|
||||
break;
|
||||
|
@ -793,7 +793,6 @@ abstract public class AbstractAdaCodegen extends DefaultCodegen implements Codeg
|
||||
CodegenSecurity opSecurity = new CodegenSecurity();
|
||||
opSecurity.name = authMethod.name;
|
||||
opSecurity.type = authMethod.type;
|
||||
opSecurity.hasMore = false;
|
||||
opSecurity.isBasic = authMethod.isBasic;
|
||||
opSecurity.isApiKey = authMethod.isApiKey;
|
||||
opSecurity.isKeyInCookie = authMethod.isKeyInCookie;
|
||||
|
@ -619,12 +619,6 @@ public abstract class AbstractApexCodegen extends DefaultCodegen implements Code
|
||||
}
|
||||
|
||||
if (removedChildEnum) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0, numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = (count < numVars) ? true : false;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
return codegenModel;
|
||||
|
@ -506,12 +506,6 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co
|
||||
}
|
||||
|
||||
if (removedChildEnum) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0, numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = (count < numVars) ? true : false;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
return codegenModel;
|
||||
|
@ -1344,13 +1344,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
}
|
||||
|
||||
if (removedChildEnum) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0;
|
||||
int numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = count < numVars;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
return codegenModel;
|
||||
|
@ -151,12 +151,8 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
|
||||
for (String tag : operation.getTags()) {
|
||||
Map<String, String> value = new HashMap<String, String>();
|
||||
value.put("tag", tag);
|
||||
value.put("hasMore", "true");
|
||||
tags.add(value);
|
||||
}
|
||||
if (tags.size() > 0) {
|
||||
tags.get(tags.size() - 1).remove("hasMore");
|
||||
}
|
||||
if (operation.getTags().size() > 0) {
|
||||
String tag = operation.getTags().get(0);
|
||||
operation.setTags(Arrays.asList(tag));
|
||||
|
@ -521,10 +521,6 @@ public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodege
|
||||
opsByPathEntry.put("path", entry.getKey());
|
||||
opsByPathEntry.put("operation", entry.getValue());
|
||||
List<CodegenOperation> operationsForThisPath = Lists.newArrayList(entry.getValue());
|
||||
operationsForThisPath.get(operationsForThisPath.size() - 1).hasMore = false;
|
||||
if (opsByPathList.size() < opsByPath.asMap().size()) {
|
||||
opsByPathEntry.put("hasMore", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return opsByPathList;
|
||||
|
@ -615,16 +615,11 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
if (!propertyHash.containsKey(property.name)) {
|
||||
final CodegenProperty parentVar = property.clone();
|
||||
parentVar.isInherited = true;
|
||||
parentVar.hasMore = true;
|
||||
last = parentVar;
|
||||
LOGGER.info("adding parent variable {}", property.name);
|
||||
codegenModel.parentVars.add(parentVar);
|
||||
}
|
||||
}
|
||||
|
||||
if (last != null) {
|
||||
last.hasMore = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,12 +796,6 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
}
|
||||
|
||||
if (removedChildEnum) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0, numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = count < numVars;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
}
|
||||
|
@ -296,11 +296,7 @@ public class CSharpNancyFXServerCodegen extends AbstractCSharpCodegen {
|
||||
property.name, child.classname, parent.classname));
|
||||
duplicatedByParent.isInherited = true;
|
||||
final CodegenProperty parentVar = duplicatedByParent.clone();
|
||||
parentVar.hasMore = false;
|
||||
child.parentVars.add(parentVar);
|
||||
if (previousParentVar != null) {
|
||||
previousParentVar.hasMore = true;
|
||||
}
|
||||
previousParentVar = parentVar;
|
||||
}
|
||||
}
|
||||
|
@ -332,16 +332,11 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
if (!propertyHash.containsKey(property.name)) {
|
||||
final CodegenProperty parentVar = property.clone();
|
||||
parentVar.isInherited = true;
|
||||
parentVar.hasMore = true;
|
||||
last = parentVar;
|
||||
LOGGER.debug("adding parent variable {}", property.name);
|
||||
codegenModel.parentVars.add(parentVar);
|
||||
}
|
||||
}
|
||||
|
||||
if (last != null) {
|
||||
last.hasMore = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -852,12 +847,6 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
}
|
||||
|
||||
if (removedChildEnum) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0, numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = count < numVars;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
}
|
||||
|
@ -559,7 +559,6 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
this.headers.addAll(o.headers);
|
||||
this.code = o.code;
|
||||
this.message = o.message;
|
||||
this.hasMore = o.hasMore;
|
||||
this.examples = o.examples;
|
||||
this.dataType = o.dataType;
|
||||
this.baseType = o.baseType;
|
||||
@ -655,7 +654,6 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
this.isMap = o.isMap;
|
||||
this.isArray = o.isArray;
|
||||
this.isMultipart = o.isMultipart;
|
||||
this.hasMore = o.hasMore;
|
||||
this.isResponseBinary = o.isResponseBinary;
|
||||
this.hasReference = o.hasReference;
|
||||
this.isRestfulIndex = o.isRestfulIndex;
|
||||
|
@ -406,7 +406,6 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
this.isMap = o.isMap;
|
||||
this.isArray = o.isArray;
|
||||
this.isMultipart = o.isMultipart;
|
||||
this.hasMore = o.hasMore;
|
||||
this.isResponseBinary = o.isResponseBinary;
|
||||
this.hasReference = o.hasReference;
|
||||
this.isRestfulIndex = o.isRestfulIndex;
|
||||
|
@ -518,7 +518,6 @@ public class ErlangProperCodegen extends DefaultCodegen implements CodegenConfig
|
||||
this.isMap = o.isMap;
|
||||
this.isArray = o.isArray;
|
||||
this.isMultipart = o.isMultipart;
|
||||
this.hasMore = o.hasMore;
|
||||
this.isResponseBinary = o.isResponseBinary;
|
||||
this.hasReference = o.hasReference;
|
||||
this.isRestfulIndex = o.isRestfulIndex;
|
||||
|
@ -318,7 +318,6 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf
|
||||
Map<String, Object> o = new HashMap<>();
|
||||
o.put("char", c);
|
||||
o.put("replacement", "'" + specialCharReplacements.get(c));
|
||||
o.put("hasMore", i != replacementChars.length - 1);
|
||||
replacements.add(o);
|
||||
}
|
||||
additionalProperties.put("specialCharReplacements", replacements);
|
||||
|
@ -913,7 +913,6 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
|
||||
mediaType = "text/plain";
|
||||
Map<String, String> contentType = new HashMap<>();
|
||||
contentType.put("mediaType", mediaType);
|
||||
contentType.put("hasMore", null);
|
||||
if (op.consumes == null)
|
||||
op.consumes = new ArrayList<>();
|
||||
op.consumes.add(contentType);
|
||||
@ -927,7 +926,6 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
|
||||
mediaType = "text/plain";
|
||||
Map<String, String> contentType = new HashMap<>();
|
||||
contentType.put("mediaType", mediaType);
|
||||
contentType.put("hasMore", null);
|
||||
if (op.produces == null)
|
||||
op.produces = new ArrayList<>();
|
||||
op.produces.add(contentType);
|
||||
|
@ -609,11 +609,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
Iterator<CodegenParameter> iterator = operation.allParams.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CodegenParameter param = iterator.next();
|
||||
param.hasMore = iterator.hasNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -697,15 +692,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen
|
||||
jsonMimeTypes.add(consume);
|
||||
} else
|
||||
prioritizedContentTypes.add(consume);
|
||||
|
||||
consume.put("hasMore", "true");
|
||||
}
|
||||
|
||||
prioritizedContentTypes.addAll(0, jsonMimeTypes);
|
||||
prioritizedContentTypes.addAll(0, jsonVendorMimeTypes);
|
||||
|
||||
prioritizedContentTypes.get(prioritizedContentTypes.size() - 1).put("hasMore", null);
|
||||
|
||||
return prioritizedContentTypes;
|
||||
}
|
||||
|
||||
|
@ -357,8 +357,7 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes header parameters from the list of parameters and
|
||||
* also corrects last allParams hasMore state.
|
||||
* This method removes header parameters from the list of parameters
|
||||
*
|
||||
* @param allParams list of all parameters
|
||||
*/
|
||||
@ -374,7 +373,6 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
|
||||
allParams.add(p);
|
||||
}
|
||||
}
|
||||
allParams.get(allParams.size() - 1).hasMore = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -554,12 +552,8 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
|
||||
for (String tag : operation.getTags()) {
|
||||
Map<String, String> value = new HashMap<String, String>();
|
||||
value.put("tag", tag);
|
||||
value.put("hasMore", "true");
|
||||
tags.add(value);
|
||||
}
|
||||
if (tags.size() > 0) {
|
||||
tags.get(tags.size() - 1).remove("hasMore");
|
||||
}
|
||||
if (operation.getTags().size() > 0) {
|
||||
String tag = operation.getTags().get(0);
|
||||
operation.setTags(Arrays.asList(tag));
|
||||
|
@ -1060,12 +1060,6 @@ public class JavascriptApolloClientCodegen extends DefaultCodegen implements Cod
|
||||
}
|
||||
|
||||
if (removedChildEnum) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0, numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = (count < numVars) ? true : false;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
}
|
||||
|
@ -1140,12 +1140,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
}
|
||||
|
||||
if (removedChildEnum) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0, numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = (count < numVars) ? true : false;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
break;
|
||||
}
|
||||
String value = String.valueOf(enumValues.get(i));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(value, (Boolean) (i + 1 < enumValues.size())));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(value));
|
||||
}
|
||||
columnDefinition.put("colDataType", "ENUM");
|
||||
columnDefinition.put("colDataTypeArguments", columnDataTypeArguments);
|
||||
@ -455,7 +455,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
break;
|
||||
}
|
||||
String value = String.valueOf(enumValues.get(i));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(value, (Boolean) (i + 1 < enumValues.size())));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(value));
|
||||
}
|
||||
columnDefinition.put("colDataType", "ENUM");
|
||||
columnDefinition.put("colDataTypeArguments", columnDataTypeArguments);
|
||||
@ -470,8 +470,8 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
columnDefinition.put("colDataType", "DECIMAL");
|
||||
columnDefinition.put("colUnsigned", unsigned);
|
||||
columnDefinition.put("colDataTypeArguments", columnDataTypeArguments);
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(20, true));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(9, false));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(20));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(9));
|
||||
}
|
||||
|
||||
if (Boolean.TRUE.equals(required)) {
|
||||
@ -525,7 +525,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
columnDefinition.put("colName", colName);
|
||||
columnDefinition.put("colDataType", "TINYINT");
|
||||
columnDefinition.put("colDataTypeArguments", columnDataTypeArguments);
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(1, false));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(1));
|
||||
|
||||
if (Boolean.TRUE.equals(required)) {
|
||||
columnDefinition.put("colNotNull", true);
|
||||
@ -593,7 +593,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
break;
|
||||
}
|
||||
String value = String.valueOf(enumValues.get(i));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(value, (Boolean) (i + 1 < enumValues.size())));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument(value));
|
||||
}
|
||||
} else if (dataType.equals("MEDIUMBLOB")) {
|
||||
columnDefinition.put("colDataType", "MEDIUMBLOB");
|
||||
@ -602,7 +602,7 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
columnDefinition.put("colDataType", matchedStringType);
|
||||
if (matchedStringType.equals("CHAR") || matchedStringType.equals("VARCHAR")) {
|
||||
columnDefinition.put("colDataTypeArguments", columnDataTypeArguments);
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument((maxLength != null) ? maxLength : 255, false));
|
||||
columnDataTypeArguments.add(toCodegenMysqlDataTypeArgument((maxLength != null) ? maxLength : 255));
|
||||
}
|
||||
}
|
||||
|
||||
@ -783,10 +783,9 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
* Generates codegen property for MySQL data type argument
|
||||
*
|
||||
* @param value argument value
|
||||
* @param hasMore shows whether codegen has more arguments or not
|
||||
* @return generated codegen property
|
||||
*/
|
||||
public HashMap<String, Object> toCodegenMysqlDataTypeArgument(Object value, Boolean hasMore) {
|
||||
public HashMap<String, Object> toCodegenMysqlDataTypeArgument(Object value) {
|
||||
HashMap<String, Object> arg = new HashMap<String, Object>();
|
||||
if (value instanceof String) {
|
||||
arg.put("isString", true);
|
||||
@ -807,7 +806,6 @@ public class MysqlSchemaCodegen extends DefaultCodegen implements CodegenConfig
|
||||
LOGGER.warn("MySQL data type argument can be primitive type only. Class '" + value.getClass() + "' is provided");
|
||||
}
|
||||
arg.put("argumentValue", value);
|
||||
arg.put("hasMore", hasMore);
|
||||
return arg;
|
||||
}
|
||||
|
||||
|
@ -295,10 +295,6 @@ public class NodeJSExpressServerCodegen extends DefaultCodegen implements Codege
|
||||
opsByPathEntry.put("path", entry.getKey());
|
||||
opsByPathEntry.put("operation", entry.getValue());
|
||||
List<CodegenOperation> operationsForThisPath = Lists.newArrayList(entry.getValue());
|
||||
operationsForThisPath.get(operationsForThisPath.size() - 1).hasMore = false;
|
||||
if (opsByPathList.size() < opsByPath.asMap().size()) {
|
||||
opsByPathEntry.put("hasMore", "true");
|
||||
}
|
||||
}
|
||||
|
||||
return opsByPathList;
|
||||
|
@ -248,13 +248,6 @@ public class ScalaAkkaClientCodegen extends AbstractScalaCodegen implements Code
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
// Adapt 'hasMore'
|
||||
it = codegenSecurities.iterator();
|
||||
while (it.hasNext()) {
|
||||
final CodegenSecurity security = it.next();
|
||||
security.hasMore = it.hasNext();
|
||||
}
|
||||
|
||||
if (codegenSecurities.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements
|
||||
|
||||
LinkedList<TextOrMatcher> pathMatchers = new LinkedList<>();
|
||||
for (String path : allPaths) {
|
||||
TextOrMatcher textOrMatcher = new TextOrMatcher("", true, true);
|
||||
TextOrMatcher textOrMatcher = new TextOrMatcher("", true);
|
||||
if (path.startsWith("{") && path.endsWith("}")) {
|
||||
String parameterName = path.substring(1, path.length() - 1);
|
||||
for (CodegenParameter pathParam : codegenOperation.pathParams) {
|
||||
@ -322,8 +322,6 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements
|
||||
pathMatchers.add(textOrMatcher);
|
||||
}
|
||||
}
|
||||
pathMatchers.getLast().hasMore = false;
|
||||
|
||||
codegenOperation.vendorExtensions.put("x-paths", pathMatchers);
|
||||
}
|
||||
|
||||
@ -395,13 +393,6 @@ public class ScalaAkkaHttpServerCodegen extends AbstractScalaCodegen implements
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0, size = fileParams.size(); i < size; ++i) {
|
||||
fileParams.get(i).hasMore = i < size - 1;
|
||||
}
|
||||
for (int i = 0, size = nonFileParams.size(); i < size; ++i) {
|
||||
nonFileParams.get(i).hasMore = i < size - 1;
|
||||
}
|
||||
|
||||
HashSet<Marshaller> operationSpecificMarshallers = new HashSet<>();
|
||||
for (CodegenResponse response : op.responses) {
|
||||
if (!response.primitiveType) {
|
||||
@ -482,12 +473,10 @@ class PathMatcherPattern {
|
||||
class TextOrMatcher {
|
||||
String value;
|
||||
boolean isText;
|
||||
boolean hasMore;
|
||||
|
||||
public TextOrMatcher(String value, boolean isText, boolean hasMore) {
|
||||
public TextOrMatcher(String value, boolean isText) {
|
||||
this.value = value;
|
||||
this.isText = isText;
|
||||
this.hasMore = hasMore;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -496,12 +485,11 @@ class TextOrMatcher {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
TextOrMatcher that = (TextOrMatcher) o;
|
||||
return isText == that.isText &&
|
||||
hasMore == that.hasMore &&
|
||||
value.equals(that.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(value, isText, hasMore);
|
||||
return Objects.hash(value, isText);
|
||||
}
|
||||
}
|
||||
|
@ -421,7 +421,8 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem
|
||||
StringBuilder defaultValue = new StringBuilder();
|
||||
defaultValue.append(cm.classname).append('(');
|
||||
|
||||
for (CodegenProperty var : cm.vars) {
|
||||
for(int i = 0; i < cm.vars.size(); i++) {
|
||||
CodegenProperty var = cm.vars.get(i);
|
||||
if (!var.required) {
|
||||
defaultValue.append("None");
|
||||
} else if (models.containsKey(var.dataType)) {
|
||||
@ -435,7 +436,7 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem
|
||||
defaultValue.append("null");
|
||||
}
|
||||
|
||||
if (var.hasMore) {
|
||||
if (i < cm.vars.size()-1) {
|
||||
defaultValue.append(", ");
|
||||
}
|
||||
}
|
||||
|
@ -252,13 +252,6 @@ public class ScalaSttpClientCodegen extends AbstractScalaCodegen implements Code
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
// Adapt 'hasMore'
|
||||
it = codegenSecurities.iterator();
|
||||
while (it.hasNext()) {
|
||||
final CodegenSecurity security = it.next();
|
||||
security.hasMore = it.hasNext();
|
||||
}
|
||||
|
||||
if (codegenSecurities.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
@ -563,12 +563,8 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
for (String tag : operation.getTags()) {
|
||||
Map<String, String> value = new HashMap<String, String>();
|
||||
value.put("tag", tag);
|
||||
value.put("hasMore", "true");
|
||||
tags.add(value);
|
||||
}
|
||||
if (tags.size() > 0) {
|
||||
tags.get(tags.size() - 1).remove("hasMore");
|
||||
}
|
||||
if (operation.getTags().size() > 0) {
|
||||
String tag = operation.getTags().get(0);
|
||||
operation.setTags(Arrays.asList(tag));
|
||||
@ -665,8 +661,7 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes header parameters from the list of parameters and also
|
||||
* corrects last allParams hasMore state.
|
||||
* This method removes header parameters from the list of parameters
|
||||
*
|
||||
* @param allParams list of all parameters
|
||||
*/
|
||||
@ -682,9 +677,6 @@ public class SpringCodegen extends AbstractJavaCodegen
|
||||
allParams.add(p);
|
||||
}
|
||||
}
|
||||
if (!allParams.isEmpty()) {
|
||||
allParams.get(allParams.size() - 1).hasMore = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -309,13 +309,6 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
}
|
||||
|
||||
if (removedChildProperty) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0;
|
||||
int numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = count < numVars;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
|
||||
|
@ -303,13 +303,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
}
|
||||
|
||||
if (removedChildProperty) {
|
||||
// If we removed an entry from this model's vars, we need to ensure hasMore is updated
|
||||
int count = 0;
|
||||
int numVars = codegenProperties.size();
|
||||
for (CodegenProperty codegenProperty : codegenProperties) {
|
||||
count += 1;
|
||||
codegenProperty.hasMore = count < numVars;
|
||||
}
|
||||
codegenModel.vars = codegenProperties;
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,6 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen
|
||||
this.isMap = o.isMap;
|
||||
this.isArray = o.isArray;
|
||||
this.isMultipart = o.isMultipart;
|
||||
this.hasMore = o.hasMore;
|
||||
this.isResponseBinary = o.isResponseBinary;
|
||||
this.isResponseFile = o.isResponseFile;
|
||||
this.hasReference = o.hasReference;
|
||||
|
@ -121,16 +121,8 @@ public class OneOfImplementorAdditionalData {
|
||||
}
|
||||
|
||||
// Add oneOf-containing models properties - we need to properly set the hasMore values to make rendering correct
|
||||
if (implcm.vars.size() > 0 && additionalProps.size() > 0) {
|
||||
implcm.vars.get(implcm.vars.size() - 1).hasMore = true;
|
||||
}
|
||||
for (int i = 0; i < additionalProps.size(); i++) {
|
||||
CodegenProperty var = additionalProps.get(i);
|
||||
if (i == additionalProps.size() - 1) {
|
||||
var.hasMore = false;
|
||||
} else {
|
||||
var.hasMore = true;
|
||||
}
|
||||
implcm.vars.add(var);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ package body {{package}}.Clients is
|
||||
-- {{#lambdaAdaComment}}{{unescapedNotes}}{{/lambdaAdaComment}}{{/vendorExtensions.x-has-notes}}
|
||||
procedure {{operationId}}
|
||||
(Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}}
|
||||
{{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{#hasMore}};{{/hasMore}}{{/allParams}}{{#returnType}};
|
||||
{{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{^-last}};{{/-last}}{{/allParams}}{{#returnType}};
|
||||
Result : out {{returnType}}{{/returnType}}) is
|
||||
URI : Swagger.Clients.URI_Type;{{#hasBodyParam}}
|
||||
Req : Swagger.Clients.Request_Type;{{/hasBodyParam}}{{#hasFormParams}}
|
||||
@ -20,10 +20,10 @@ package body {{package}}.Clients is
|
||||
{{/returnType}}
|
||||
begin
|
||||
{{#hasProduces}}
|
||||
Client.Set_Accept (({{#produces}}{{#vendorExtensions.x-has-uniq-produces}}1 => {{/vendorExtensions.x-has-uniq-produces}}Swagger.Clients.{{adaMediaType}}{{#hasMore}},
|
||||
{{/hasMore}}{{/produces}}));{{/hasProduces}}{{#hasBodyParam}}
|
||||
Client.Initialize (Req, ({{#hasConsumes}}{{#consumes}}{{#vendorExtensions.x-has-uniq-consumes}}1 => {{/vendorExtensions.x-has-uniq-consumes}}Swagger.Clients.{{adaMediaType}}{{#hasMore}},
|
||||
{{/hasMore}}{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}1 => Swagger.Clients.APPLICATION_JSON{{/hasConsumes}}));{{#bodyParams}}{{#vendorExtensions.x-is-model-type}}
|
||||
Client.Set_Accept (({{#produces}}{{#vendorExtensions.x-has-uniq-produces}}1 => {{/vendorExtensions.x-has-uniq-produces}}Swagger.Clients.{{adaMediaType}}{{^-last}},
|
||||
{{/-last}}{{/produces}}));{{/hasProduces}}{{#hasBodyParam}}
|
||||
Client.Initialize (Req, ({{#hasConsumes}}{{#consumes}}{{#vendorExtensions.x-has-uniq-consumes}}1 => {{/vendorExtensions.x-has-uniq-consumes}}Swagger.Clients.{{adaMediaType}}{{^-last}},
|
||||
{{/-last}}{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}1 => Swagger.Clients.APPLICATION_JSON{{/hasConsumes}}));{{#bodyParams}}{{#vendorExtensions.x-is-model-type}}
|
||||
{{package}}.Models.Serialize (Req.Stream, "", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}}{{#isFile}}
|
||||
-- TODO: Serialize (Req.Stream, "{{basename}}", {{paramName}});{{/isFile}}{{^isFile}}{{^isLong}}
|
||||
Req.Stream.Write_Entity ("{{baseName}}", {{paramName}});{{/isLong}}{{#isLong}}
|
||||
|
@ -15,7 +15,7 @@ package {{package}}.Clients is
|
||||
-- {{#lambdaAdaComment}}{{unescapedNotes}}{{/lambdaAdaComment}}{{/vendorExtensions.x-has-notes}}
|
||||
procedure {{operationId}}
|
||||
(Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}}
|
||||
{{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{#hasMore}};{{/hasMore}}{{/allParams}}{{#returnType}};
|
||||
{{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{^-last}};{{/-last}}{{/allParams}}{{#returnType}};
|
||||
Result : out {{returnType}}{{/returnType}});
|
||||
|
||||
{{/operation}}
|
||||
|
@ -21,8 +21,8 @@ package body {{package}}.Servers is
|
||||
overriding
|
||||
procedure {{operationId}}
|
||||
(Server : in out Server_Type{{#hasParams}};{{/hasParams}}
|
||||
{{#allParams}}{{paramName}} : in {{dataType}}{{#hasMore}};
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}};
|
||||
{{#allParams}}{{paramName}} : in {{dataType}}{{^-last}};
|
||||
{{/-last}}{{/allParams}}{{#returnType}};
|
||||
Result : out {{returnType}}{{/returnType}};
|
||||
Context : in out Swagger.Servers.Context_Type) is
|
||||
begin
|
||||
|
@ -65,8 +65,8 @@ package body {{package}}.Skeletons is
|
||||
Deserialize (Input, "{{baseName}}", {{paramName}});{{/isLong}}{{/isFile}}{{/vendorExtensions.x-is-model-type}}{{/bodyParams}}
|
||||
{{/hasBodyParam}}
|
||||
Impl.{{operationId}}
|
||||
({{#allParams}}{{paramName}}{{#hasMore}},
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}}{{#hasParams}}, {{/hasParams}}Result{{/returnType}}, Context);
|
||||
({{#allParams}}{{paramName}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}{{#returnType}}{{#hasParams}}, {{/hasParams}}Result{{/returnType}}, Context);
|
||||
{{/hasParams}}
|
||||
{{^hasParams}}
|
||||
{{#returnType}}
|
||||
@ -161,8 +161,8 @@ package body {{package}}.Skeletons is
|
||||
Deserialize (Input, "{{baseName}}", {{paramName}});{{/isLong}}{{/isFile}}{{/vendorExtensions.x-is-model-type}}{{/bodyParams}}
|
||||
{{/hasBodyParam}}
|
||||
Server.{{operationId}}
|
||||
({{#allParams}}{{paramName}}{{#hasMore}},
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}}{{#hasParams}}, {{/hasParams}}Result{{/returnType}}, Context);
|
||||
({{#allParams}}{{paramName}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}{{#returnType}}{{#hasParams}}, {{/hasParams}}Result{{/returnType}}, Context);
|
||||
{{/hasParams}}
|
||||
{{^hasParams}}
|
||||
{{#returnType}}
|
||||
@ -212,14 +212,14 @@ package body {{package}}.Skeletons is
|
||||
-- {{summary}}
|
||||
{{#hasParams}}
|
||||
procedure {{operationId}}
|
||||
({{#allParams}}{{paramName}} : in {{dataType}}{{#hasMore}};
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}};
|
||||
({{#allParams}}{{paramName}} : in {{dataType}}{{^-last}};
|
||||
{{/-last}}{{/allParams}}{{#returnType}};
|
||||
Result : out {{returnType}}{{/returnType}};
|
||||
Context : in out Swagger.Servers.Context_Type) is
|
||||
begin
|
||||
Impl.{{operationId}}
|
||||
({{#allParams}}{{paramName}}{{#hasMore}},
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}},
|
||||
({{#allParams}}{{paramName}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}{{#returnType}},
|
||||
Result{{/returnType}},
|
||||
Context);
|
||||
end {{operationId}};
|
||||
|
@ -21,8 +21,8 @@ package {{package}}.Skeletons is
|
||||
-- {{#lambdaAdaComment}}{{unescapedNotes}}{{/lambdaAdaComment}}{{/vendorExtensions.x-has-notes}}
|
||||
procedure {{operationId}}
|
||||
(Server : in out Server_Type{{#hasParams}};{{/hasParams}}
|
||||
{{#allParams}}{{paramName}} : in {{dataType}}{{#hasMore}};
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}};
|
||||
{{#allParams}}{{paramName}} : in {{dataType}}{{^-last}};
|
||||
{{/-last}}{{/allParams}}{{#returnType}};
|
||||
Result : out {{returnType}}{{/returnType}};
|
||||
Context : in out Swagger.Servers.Context_Type) is abstract;
|
||||
{{/operation}}
|
||||
@ -89,8 +89,8 @@ package {{package}}.Skeletons is
|
||||
-- {{summary}}
|
||||
{{#hasParams}}
|
||||
procedure {{operationId}}
|
||||
({{#allParams}}{{paramName}} : in {{dataType}}{{#hasMore}};
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}};
|
||||
({{#allParams}}{{paramName}} : in {{dataType}}{{^-last}};
|
||||
{{/-last}}{{/allParams}}{{#returnType}};
|
||||
Result : out {{returnType}}{{/returnType}};
|
||||
Context : in out Swagger.Servers.Context_Type);
|
||||
{{/hasParams}}
|
||||
|
@ -28,8 +28,8 @@ package {{package}}.Servers is
|
||||
overriding
|
||||
procedure {{operationId}}
|
||||
(Server : in out Server_Type{{#hasParams}};{{/hasParams}}
|
||||
{{#allParams}}{{paramName}} : in {{dataType}}{{#hasMore}};
|
||||
{{/hasMore}}{{/allParams}}{{#returnType}};
|
||||
{{#allParams}}{{paramName}} : in {{dataType}}{{^-last}};
|
||||
{{/-last}}{{/allParams}}{{#returnType}};
|
||||
Result : out {{returnType}}{{/returnType}};
|
||||
Context : in out Swagger.Servers.Context_Type);
|
||||
{{/operation}}
|
||||
|
@ -66,5 +66,5 @@ Note: You don't need to specify includes for models and include folder seperatel
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
@ -116,7 +116,7 @@ end:
|
||||
{{#pathParams}}
|
||||
|
||||
// Path Params
|
||||
long sizeOfPathParams_{{{paramName}}} = {{#pathParams}}{{#isLong}}sizeof({{paramName}})+3{{/isLong}}{{#isString}}strlen({{paramName}})+3{{/isString}}{{#hasMore}} + {{/hasMore}}{{/pathParams}} + strlen("{ {{paramName}} }");
|
||||
long sizeOfPathParams_{{{paramName}}} = {{#pathParams}}{{#isLong}}sizeof({{paramName}})+3{{/isLong}}{{#isString}}strlen({{paramName}})+3{{/isString}}{{^-last}} + {{/-last}}{{/pathParams}} + strlen("{ {{paramName}} }");
|
||||
{{#isNumeric}}
|
||||
if({{paramName}} == 0){
|
||||
goto end;
|
||||
|
@ -130,64 +130,64 @@ char* {{name}}{{classname}}_ToString({{projectName}}_{{classVarName}}_{{enumName
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isArray}}
|
||||
{{#isPrimitiveType}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isArray}}
|
||||
{{#isMap}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isMap}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
@ -704,64 +704,64 @@ fail:
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim_enum{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim_enum{{^required}} : -1{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valuedouble{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valuedouble{{^required}} : 0{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : -1{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : -1{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
{{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isArray}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isArray}}
|
||||
{{#isMap}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
|
||||
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{^-last}},{{/-last}}
|
||||
{{/isMap}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
|
@ -150,64 +150,64 @@ typedef struct {{classname}}_t {
|
||||
{{^isPrimitiveType}}
|
||||
{{#isModel}}
|
||||
{{#isEnum}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isEnum}}
|
||||
{{/isModel}}
|
||||
{{#isUuid}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isUuid}}
|
||||
{{#isEmail}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isEmail}}
|
||||
{{#isFreeFormObject}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isFreeFormObject}}
|
||||
{{/isPrimitiveType}}
|
||||
{{#isPrimitiveType}}
|
||||
{{#isNumeric}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isNumeric}}
|
||||
{{#isBoolean}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isBoolean}}
|
||||
{{#isEnum}}
|
||||
{{#isString}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{projectName}}_{{classVarName}}_{{enumName}}_e {{name}}{{^-last}},{{/-last}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{^isEnum}}
|
||||
{{#isString}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isString}}
|
||||
{{/isEnum}}
|
||||
{{#isByteArray}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isBinary}}
|
||||
{{#isDate}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isDate}}
|
||||
{{#isDateTime}}
|
||||
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isDateTime}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isContainer}}
|
||||
{{#isContainer}}
|
||||
{{#isArray}}
|
||||
{{#isPrimitiveType}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}}_t *{{name}}{{^-last}},{{/-last}}
|
||||
{{/isPrimitiveType}}
|
||||
{{/isArray}}
|
||||
{{#isMap}}
|
||||
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
|
||||
{{datatype}} {{name}}{{^-last}},{{/-last}}
|
||||
{{/isMap}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
|
@ -29,13 +29,13 @@
|
||||
{{classname}} = {{classname}}_create(
|
||||
{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{#example}}{{{.}}}{{/example}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#example}}{{{.}}}{{/example}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress
|
||||
{{/isEnum}}{{^isEnum}} // false, not to have infinite recursion
|
||||
instantiate_{{{dataType}}}(0){{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{#hasMore}},{{/hasMore}}
|
||||
instantiate_{{{dataType}}}(0){{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{^-last}},{{/-last}}
|
||||
{{/vars}}
|
||||
);
|
||||
} else {
|
||||
{{classname}} = {{classname}}_create(
|
||||
{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{#example}}{{{.}}}{{/example}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#example}}{{{.}}}{{/example}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress
|
||||
{{/isEnum}}{{^isEnum}}NULL{{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{#hasMore}},{{/hasMore}}
|
||||
{{/isEnum}}{{^isEnum}}NULL{{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{^-last}},{{/-last}}
|
||||
{{/vars}}
|
||||
);
|
||||
}
|
||||
|
@ -61,5 +61,5 @@ Class | Method | HTTP request | Description
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
@ -13,7 +13,7 @@ feature -- API Access
|
||||
|
||||
{{#operation}}
|
||||
|
||||
{{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}{{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}detachable {{{dataType}}}{{/isPrimitiveType}}{{/required}}{{#hasMore}}; {{/hasMore}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}}
|
||||
{{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}{{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}detachable {{{dataType}}}{{/isPrimitiveType}}{{/required}}{{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}}
|
||||
-- {{summary}}
|
||||
-- {{notes}}
|
||||
-- {{#allParams}}
|
||||
@ -59,11 +59,11 @@ feature -- API Access
|
||||
end
|
||||
{{/formParams}}
|
||||
|
||||
if attached {STRING} api_client.select_header_accept (<<{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}>>) as l_accept then
|
||||
if attached {STRING} api_client.select_header_accept (<<{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}>>) as l_accept then
|
||||
l_request.add_header(l_accept,"Accept");
|
||||
end
|
||||
l_request.add_header(api_client.select_header_content_type (<<{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}>>),"Content-Type")
|
||||
l_request.set_auth_names (<<{{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}>>)
|
||||
l_request.add_header(api_client.select_header_content_type (<<{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}>>),"Content-Type")
|
||||
l_request.set_auth_names (<<{{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}}>>)
|
||||
l_response := api_client.call_api (l_path, "{{httpMethod}}", l_request, {{#returnType}}Void{{/returnType}}{{^returnType}}agent serializer{{/returnType}}, {{#returnType}}agent deserializer{{/returnType}}{{^returnType}}Void{{/returnType}})
|
||||
{{#returnType}}
|
||||
if l_response.has_error then
|
||||
|
@ -11,7 +11,7 @@ Feature | HTTP request | Description
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
# **{{{operationId}}}**
|
||||
> {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}} detachable {{{dataType}}}{{/required}} {{#hasMore}}; {{/hasMore}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}}
|
||||
> {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}} detachable {{{dataType}}}{{/required}} {{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}}
|
||||
|
||||
|
||||
{{{summary}}}{{#notes}}
|
||||
@ -36,8 +36,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -42,10 +42,10 @@ feature -- Test routines
|
||||
{{/allParams}}
|
||||
|
||||
{{#returnType}}
|
||||
-- l_response := api.{{operationId}}{{#hasParams}}({{#allParams}}l_{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{/hasParams}}
|
||||
-- l_response := api.{{operationId}}{{#hasParams}}({{#allParams}}l_{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}}
|
||||
{{/returnType}}
|
||||
{{^returnType}}
|
||||
-- api.{{operationId}}{{#hasParams}}({{#allParams}}l_{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{/hasParams}}
|
||||
-- api.{{operationId}}{{#hasParams}}({{#allParams}}l_{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}}
|
||||
{{/returnType}}
|
||||
assert ("not_implemented", False)
|
||||
end
|
||||
|
@ -45,7 +45,7 @@ def apiInstance = new {{classname}}()
|
||||
{{#allParams}}def {{paramName}} = {{{example}}} // {{{dataType}}} | {{{description}}}
|
||||
{{/allParams}}
|
||||
|
||||
apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
|
||||
{
|
||||
// on success
|
||||
{{#returnType}}def result = ({{returnType}})it
|
||||
|
@ -48,39 +48,26 @@ class {{classname}} {
|
||||
{{#consumes.0}}
|
||||
contentType = '{{{mediaType}}}';
|
||||
{{/consumes.0}}
|
||||
{{/bodyParam}}
|
||||
{{#bodyParams.0}}
|
||||
{{^hasMore}}
|
||||
bodyParams = {{paramName}}
|
||||
{{/hasMore}}
|
||||
{{#hasMore}}
|
||||
bodyParams = [:]
|
||||
bodyParams.put("{{baseName}}", {{paramName}})
|
||||
{{/hasMore}}
|
||||
{{/bodyParams.0}}
|
||||
{{#bodyParams}}
|
||||
{{#secondaryParam}}
|
||||
bodyParams.put("{{baseName}}", {{paramName}})
|
||||
{{/secondaryParam}}
|
||||
{{/bodyParams}}
|
||||
{{/bodyParam}}
|
||||
|
||||
{{#hasFormParams}}
|
||||
{{#consumes.0}}
|
||||
contentType = '{{{mediaType}}}';
|
||||
{{/consumes.0}}
|
||||
{{#formParams.0}}
|
||||
{{^hasMore}}
|
||||
bodyParams = {{paramName}}
|
||||
{{/hasMore}}
|
||||
{{#hasMore}}
|
||||
{{#formParams}}
|
||||
{{#-first}}
|
||||
{{^-last}}
|
||||
bodyParams = [:]
|
||||
bodyParams.put("{{baseName}}", {{paramName}})
|
||||
{{/hasMore}}
|
||||
{{/formParams.0}}
|
||||
{{#formParams}}
|
||||
{{#secondaryParam}}
|
||||
{{/-last}}
|
||||
{{#-last}}
|
||||
bodyParams = {{paramName}}
|
||||
{{/-last}}
|
||||
{{/-first}}
|
||||
{{^-first}}
|
||||
bodyParams.put("{{baseName}}", {{paramName}})
|
||||
{{/secondaryParam}}
|
||||
{{/-first}}
|
||||
{{/formParams}}
|
||||
{{/hasFormParams}}
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class {{{classname}}}Example {
|
||||
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
|
||||
System.out.println(result);{{/returnType}}
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
|
||||
@ -219,5 +219,5 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
@ -63,7 +63,7 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||
{{#allParams}}{{#required}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
@ -99,16 +99,16 @@ public class {{classname}} {
|
||||
{{/formParams}}
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||
{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
|
||||
|
||||
{{#returnType}}
|
||||
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
|
||||
|
@ -14,7 +14,7 @@ Method | HTTP request | Description
|
||||
|
||||
## {{operationId}}
|
||||
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
|
||||
|
||||
{{summary}}{{#notes}}
|
||||
|
||||
@ -60,7 +60,7 @@ public class Example {
|
||||
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
|
||||
System.out.println(result);{{/returnType}}
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
|
||||
@ -91,8 +91,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{#responses.0}}
|
||||
### HTTP response details
|
||||
|
@ -42,7 +42,7 @@ public class {{classname}}Test {
|
||||
//{{#allParams}}
|
||||
//{{{dataType}}} {{paramName}} = null;
|
||||
//{{/allParams}}
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class ApiClient {
|
||||
auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
{{/isOAuth}}
|
||||
} else {{/authMethods}}{
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
|
@ -38,6 +38,6 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
||||
|
@ -35,14 +35,14 @@ public interface {{classname}} extends ApiClient.Api {
|
||||
* @see <a href="{{url}}">{{summary}} Documentation</a>
|
||||
{{/externalDocs}}
|
||||
*/
|
||||
@RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")
|
||||
@RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}")
|
||||
@Headers({
|
||||
{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}",
|
||||
{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}}
|
||||
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}},
|
||||
{{/hasMore}}{{/headerParams}}
|
||||
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
|
||||
{{/-last}}{{/headerParams}}
|
||||
})
|
||||
{{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{baseName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{baseName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{#hasQueryParams}}
|
||||
|
||||
/**
|
||||
@ -73,12 +73,12 @@ public interface {{classname}} extends ApiClient.Api {
|
||||
* @see <a href="{{url}}">{{summary}} Documentation</a>
|
||||
{{/externalDocs}}
|
||||
*/
|
||||
@RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{#hasMore}}&{{/hasMore}}{{/queryParams}}")
|
||||
@RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{=<% %>=}}{<%paramName%>}<%={{ }}=%>{{^-last}}&{{/-last}}{{/queryParams}}")
|
||||
@Headers({
|
||||
{{#vendorExtensions.x-contentType}} "Content-Type: {{vendorExtensions.x-contentType}}",
|
||||
{{/vendorExtensions.x-contentType}} "Accept: {{vendorExtensions.x-accepts}}",{{#headerParams}}
|
||||
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}},
|
||||
{{/hasMore}}{{/headerParams}}
|
||||
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
|
||||
{{/-last}}{{/headerParams}}
|
||||
})
|
||||
{{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{baseName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map<String, Object> queryParams);
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class {{classname}}Test {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
@ -59,7 +59,7 @@ public class {{classname}}Test {
|
||||
{{/allParams}}
|
||||
{{classname}}.{{operationIdCamelCase}}QueryParams queryParams = new {{classname}}.{{operationIdCamelCase}}QueryParams()
|
||||
{{#queryParams}}
|
||||
.{{paramName}}(null){{^hasMore}};{{/hasMore}}
|
||||
.{{paramName}}(null){{#-last}};{{/-last}}
|
||||
{{/queryParams}}
|
||||
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams);
|
||||
|
||||
|
@ -56,8 +56,8 @@ public class {{classname}} {
|
||||
{{/externalDocs}}
|
||||
|
||||
**/
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws IOException {
|
||||
{{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException {
|
||||
{{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
|
||||
TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {};
|
||||
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}}
|
||||
}
|
||||
@ -75,13 +75,13 @@ public class {{classname}} {
|
||||
{{/externalDocs}}
|
||||
|
||||
**/
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
|
||||
{{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}params);{{#returnType}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
|
||||
{{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}params);{{#returnType}}
|
||||
TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {};
|
||||
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}}
|
||||
}
|
||||
|
||||
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws IOException {
|
||||
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException {
|
||||
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
|
||||
@ -112,7 +112,7 @@ public class {{classname}} {
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
|
||||
}{{#bodyParam}}
|
||||
|
||||
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{#isBodyParam}}java.io.InputStream {{paramName}}{{/isBodyParam}}{{^isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}}, String mediaType) throws IOException {
|
||||
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{#isBodyParam}}java.io.InputStream {{paramName}}{{/isBodyParam}}{{^isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}, String mediaType) throws IOException {
|
||||
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
|
||||
@ -145,7 +145,7 @@ public class {{classname}} {
|
||||
return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute();
|
||||
}{{/bodyParam}}
|
||||
|
||||
public HttpResponse {{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
|
||||
public HttpResponse {{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
|
||||
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
|
||||
if ({{paramName}} == null) {
|
||||
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
|
||||
|
@ -37,7 +37,7 @@ public class {{classname}}Test {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
@ -81,8 +81,8 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
{{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}.getData(){{/returnType}};
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
{{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}};
|
||||
}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
|
||||
@ -115,7 +115,7 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||
{{#allParams}}{{#required}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
@ -150,16 +150,16 @@ public class {{classname}} {
|
||||
{{/formParams}}
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||
{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
|
||||
|
||||
{{#returnType}}
|
||||
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
|
||||
@ -176,7 +176,7 @@ public class {{classname}} {
|
||||
private {{#isRequired}}final {{/isRequired}}{{{dataType}}} {{paramName}};
|
||||
{{/allParams}}
|
||||
|
||||
private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) {
|
||||
private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) {
|
||||
{{#pathParams}}
|
||||
this.{{paramName}} = {{paramName}};
|
||||
{{/pathParams}}
|
||||
@ -236,7 +236,7 @@ public class {{classname}} {
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException {
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,8 +253,8 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) throws ApiException {
|
||||
return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}});
|
||||
public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException {
|
||||
return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}});
|
||||
}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{/operation}}
|
||||
|
@ -15,10 +15,10 @@ Method | HTTP request | Description
|
||||
## {{operationId}}
|
||||
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute();
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute();
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
|
||||
{{summary}}{{#notes}}
|
||||
@ -66,10 +66,10 @@ public class Example {
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}){{#allParams}}{{^isPathParam}}
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}
|
||||
.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}
|
||||
.execute();
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
@ -105,8 +105,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{#responses.0}}
|
||||
### HTTP response details
|
||||
|
@ -41,10 +41,10 @@ public class {{classname}}Test {
|
||||
//{{{dataType}}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}){{#allParams}}{{^isPathParam}}
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}
|
||||
// .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}
|
||||
// .execute();
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
|
@ -268,8 +268,8 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
|
||||
return false;
|
||||
}{{#hasVars}}
|
||||
{{classname}} {{classVarName}} = ({{classname}}) o;
|
||||
return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
|
||||
{{/hasMore}}{{/vars}}{{#additionalPropertiesType}}&&
|
||||
return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} &&
|
||||
{{/-last}}{{/vars}}{{#additionalPropertiesType}}&&
|
||||
Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} &&
|
||||
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
|
||||
return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
|
||||
@ -282,7 +282,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
|
||||
return HashCodeBuilder.reflectionHashCode(this);
|
||||
{{/useReflectionEqualsHashCode}}
|
||||
{{^useReflectionEqualsHashCode}}
|
||||
return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}, additionalProperties{{/additionalPropertiesType}});
|
||||
return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}, additionalProperties{{/additionalPropertiesType}});
|
||||
{{/useReflectionEqualsHashCode}}
|
||||
}
|
||||
|
||||
@ -297,15 +297,15 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
|
||||
return false;
|
||||
}{{#hasVars}}
|
||||
{{classname}} {{classVarName}} = ({{classname}}) o;
|
||||
return {{#vars}}ObjectUtils.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
|
||||
{{/hasMore}}{{/vars}}{{#parent}} &&
|
||||
return {{#vars}}ObjectUtils.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} &&
|
||||
{{/-last}}{{/vars}}{{#parent}} &&
|
||||
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
|
||||
return true;{{/hasVars}}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.hashCodeMulti({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
|
||||
return ObjectUtils.hashCodeMulti({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
|
||||
}
|
||||
|
||||
{{/supportJava6}}
|
||||
|
@ -49,12 +49,12 @@ public interface {{classname}} {
|
||||
@{{httpMethod}}
|
||||
{{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}}
|
||||
{{#hasConsumes}}
|
||||
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} })
|
||||
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} })
|
||||
{{/hasConsumes}}
|
||||
{{#hasProduces}}
|
||||
@Produces({ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} })
|
||||
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} })
|
||||
{{/hasProduces}}
|
||||
public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException, ProcessingException;
|
||||
public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException;
|
||||
{{/operation}}
|
||||
}
|
||||
{{/operations}}
|
||||
|
@ -66,7 +66,7 @@ public class {{classname}}Test {
|
||||
{{#allParams}}
|
||||
{{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}}
|
||||
{{/allParams}}
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
//{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
//{{#returnType}}assertNotNull(response);{{/returnType}}
|
||||
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class {{{classname}}}Example {
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void> result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void> result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#hasParams}}
|
||||
@ -174,5 +174,5 @@ However, the instances of the api clients created from the `ApiClient` are threa
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
@ -91,7 +91,7 @@ public class {{classname}} {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = apiRequest.{{paramName}}();
|
||||
{{/allParams}}
|
||||
{{#returnType}}return {{/returnType}}{{^returnType}}{{#asyncNative}}return {{/asyncNative}}{{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}return {{/returnType}}{{^returnType}}{{#asyncNative}}return {{/asyncNative}}{{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -115,7 +115,7 @@ public class {{classname}} {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = apiRequest.{{paramName}}();
|
||||
{{/allParams}}
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
}
|
||||
|
||||
{{/hasParams}}
|
||||
@ -141,16 +141,16 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
{{^asyncNative}}
|
||||
{{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{#returnType}}
|
||||
return localVarResponse.getData();
|
||||
{{/returnType}}
|
||||
{{/asyncNative}}
|
||||
{{#asyncNative}}
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@ -196,9 +196,9 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
{{^asyncNative}}
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
@ -227,7 +227,7 @@ public class {{classname}} {
|
||||
{{/asyncNative}}
|
||||
{{#asyncNative}}
|
||||
try {
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
return memberVarHttpClient.sendAsync(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> {
|
||||
@ -260,7 +260,7 @@ public class {{classname}} {
|
||||
{{/asyncNative}}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder {{operationId}}RequestBuilder({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
private HttpRequest.Builder {{operationId}}RequestBuilder({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
{{#allParams}}
|
||||
{{#required}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
|
@ -16,7 +16,7 @@ Method | HTTP request | Description
|
||||
## {{operationId}}
|
||||
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
> {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#hasParams}}{{operationId}}Request{{/hasParams}})
|
||||
@ -71,7 +71,7 @@ public class Example {
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void> result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} result = {{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void> result = {{/asyncNative}}{{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#hasParams}}
|
||||
@ -121,8 +121,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{#responses.0}}
|
||||
### HTTP response details
|
||||
@ -136,7 +136,7 @@ Name | Type | Description | Notes
|
||||
## {{operationId}}WithHttpInfo
|
||||
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}})
|
||||
@ -192,7 +192,7 @@ public class Example {
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
{{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
{{#hasParams}}
|
||||
@ -253,8 +253,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{#responses.0}}
|
||||
### HTTP response details
|
||||
|
@ -43,7 +43,7 @@ public class {{classname}}Test {
|
||||
{{/allParams}}
|
||||
{{^vendorExtensions.x-group-parameters}}
|
||||
{{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}} response = {{/returnType}}
|
||||
{{^returnType}}{{#asyncNative}}CompletableFuture<Void> response = {{/asyncNative}}{{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{^returnType}}{{#asyncNative}}CompletableFuture<Void> response = {{/asyncNative}}{{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{#vendorExtensions.x-group-parameters}}{{#hasParams}}
|
||||
{{classname}}.API{{operationId}}Request request = {{classname}}.API{{operationId}}Request.newBuilder(){{#allParams}}
|
||||
|
@ -267,8 +267,8 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
|
||||
return false;
|
||||
}{{#hasVars}}
|
||||
{{classname}} {{classVarName}} = ({{classname}}) o;
|
||||
return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
|
||||
{{/hasMore}}{{/vars}}{{#additionalPropertiesType}}&&
|
||||
return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} &&
|
||||
{{/-last}}{{/vars}}{{#additionalPropertiesType}}&&
|
||||
Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} &&
|
||||
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
|
||||
return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
|
||||
@ -281,7 +281,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
|
||||
return HashCodeBuilder.reflectionHashCode(this);
|
||||
{{/useReflectionEqualsHashCode}}
|
||||
{{^useReflectionEqualsHashCode}}
|
||||
return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}, additionalProperties{{/additionalPropertiesType}});
|
||||
return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}, additionalProperties{{/additionalPropertiesType}});
|
||||
{{/useReflectionEqualsHashCode}}
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class Example {
|
||||
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}}
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}
|
||||
.{{{paramName}}}({{{paramName}}}){{/optionalParams}}
|
||||
.execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}}
|
||||
System.out.println(result);{{/returnType}}
|
||||
@ -172,5 +172,5 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
@ -126,7 +126,7 @@ public class {{classname}} {
|
||||
|
||||
{{/formParams}}
|
||||
final String[] localVarAccepts = {
|
||||
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||
{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
@ -134,12 +134,12 @@ public class {{classname}} {
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
|
||||
return localVarApiClient.buildCall(localVarPath, "{{httpMethod}}", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ public class {{classname}} {
|
||||
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
|
||||
ExecutableValidator executableValidator = factory.getValidator().forExecutables();
|
||||
|
||||
Object[] parameterValues = { {{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}} };
|
||||
Object[] parameterValues = { {{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}} };
|
||||
Method method = this.getClass().getMethod("{{operationId}}WithHttpInfo"{{#allParams}}, {{#isArray}}java.util.List{{/isArray}}{{#isMap}}java.util.Map{{/isMap}}{{^isArray}}{{^isMap}}{{{dataType}}}{{/isMap}}{{/isArray}}.class{{/allParams}});
|
||||
Set<ConstraintViolation<{{classname}}>> violations = executableValidator.validateParameters(this, method,
|
||||
parameterValues);
|
||||
@ -215,8 +215,8 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
{{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
{{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
|
||||
return localVarResp.getData();{{/returnType}}
|
||||
}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
@ -247,7 +247,7 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null);
|
||||
{{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType();
|
||||
return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}}
|
||||
@ -297,7 +297,7 @@ public class {{classname}} {
|
||||
private {{{dataType}}} {{paramName}};
|
||||
{{/optionalParams}}
|
||||
|
||||
private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}) {
|
||||
private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) {
|
||||
{{#requiredParams}}
|
||||
this.{{paramName}} = {{paramName}};
|
||||
{{/requiredParams}}
|
||||
@ -361,7 +361,7 @@ public class {{classname}} {
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} execute() throws ApiException {
|
||||
{{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}}
|
||||
{{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
|
||||
return localVarResp.getData();{{/returnType}}
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ public class {{classname}} {
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException {
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -440,8 +440,8 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}) {
|
||||
return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}});
|
||||
public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}) {
|
||||
return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}});
|
||||
}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{/operation}}
|
||||
|
@ -12,8 +12,8 @@ Method | HTTP request | Description
|
||||
{{#operation}}
|
||||
<a name="{{operationId}}"></a>
|
||||
# **{{operationId}}**{{^vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}}
|
||||
|
||||
{{summary}}{{#notes}}
|
||||
|
||||
@ -58,7 +58,7 @@ public class Example {
|
||||
{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
|
||||
{{/allParams}}
|
||||
try {
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}}
|
||||
{{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}
|
||||
.{{{paramName}}}({{{paramName}}}){{/optionalParams}}
|
||||
.execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}}
|
||||
System.out.println(result);{{/returnType}}
|
||||
@ -90,8 +90,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{#responses.0}}
|
||||
### HTTP response details
|
||||
|
@ -37,7 +37,7 @@ public class {{classname}}Test {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}}
|
||||
{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}
|
||||
.{{paramName}}({{paramName}}){{/optionalParams}}
|
||||
.execute();{{/vendorExtensions.x-group-parameters}}
|
||||
|
||||
|
@ -38,6 +38,6 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class {{classname}} {
|
||||
nickname = "{{{operationId}}}",
|
||||
tags = { {{#tags}}{{#name}}"{{{name}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} })
|
||||
@ApiResponses(value = { {{#responses}}
|
||||
@ApiResponse(code = {{{code}}}, message = "{{{message}}}") {{#hasMore}},{{/hasMore}}{{/responses}} })
|
||||
@ApiResponse(code = {{{code}}}, message = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} })
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
|
@ -12,7 +12,7 @@ Method | HTTP request | Description
|
||||
{{#operation}}
|
||||
<a name="{{operationId}}"></a>
|
||||
# **{{operationId}}**
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
|
||||
> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
|
||||
|
||||
{{summary}}{{#notes}}
|
||||
|
||||
@ -55,8 +55,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
|
||||
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
|
||||
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
|
@ -56,7 +56,7 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException {
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
|
||||
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||
{{#allParams}}{{#required}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
@ -91,16 +91,16 @@ public class {{classname}} {
|
||||
{{/formParams}}
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||
{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
|
||||
|
||||
{{#returnType}}
|
||||
GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
|
||||
|
@ -71,12 +71,12 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.Resource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException {
|
||||
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.Resource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException {
|
||||
{{#returnType}}
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).getBody();
|
||||
return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).getBody();
|
||||
{{/returnType}}
|
||||
{{^returnType}}
|
||||
{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
{{/returnType}}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class {{classname}} {
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.Resource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException {
|
||||
public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.Resource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException {
|
||||
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||
{{#allParams}}{{#required}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
@ -117,31 +117,31 @@ public class {{classname}} {
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();{{#hasQueryParams}}
|
||||
|
||||
{{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{#hasMore}}
|
||||
{{/hasMore}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}}
|
||||
{{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}}
|
||||
{{/-last}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}}
|
||||
|
||||
{{#headerParams}}if ({{paramName}} != null)
|
||||
headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{#hasMore}}
|
||||
{{/hasMore}}{{/headerParams}}{{/hasHeaderParams}}{{#hasCookieParams}}
|
||||
headerParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}}
|
||||
{{/-last}}{{/headerParams}}{{/hasHeaderParams}}{{#hasCookieParams}}
|
||||
|
||||
{{#cookieParams}}if ({{paramName}} != null)
|
||||
cookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{#hasMore}}
|
||||
{{/hasMore}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}}
|
||||
cookieParams.add("{{baseName}}", apiClient.parameterToString({{paramName}}));{{^-last}}
|
||||
{{/-last}}{{/cookieParams}}{{/hasCookieParams}}{{#hasFormParams}}
|
||||
|
||||
{{#formParams}}if ({{paramName}} != null)
|
||||
formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}}
|
||||
{{/hasMore}}{{/formParams}}{{/hasFormParams}}
|
||||
formParams.{{^collectionFormat}}add{{/collectionFormat}}{{#collectionFormat}}addAll{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{^-last}}
|
||||
{{/-last}}{{/formParams}}{{/hasFormParams}}
|
||||
|
||||
final String[] localVarAccepts = { {{#hasProduces}}
|
||||
{{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
|
||||
{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
|
||||
{{/hasProduces}} };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] contentTypes = { {{#hasConsumes}}
|
||||
{{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
|
||||
{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
|
||||
{{/hasConsumes}} };
|
||||
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
|
||||
|
||||
String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
|
||||
|
||||
{{#returnType}}ParameterizedTypeReference<{{{returnType}}}> returnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};{{/returnType}}
|
||||
return apiClient.invokeAPI(path, HttpMethod.{{httpMethod}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, contentType, authNames, returnType);
|
||||
|
@ -36,7 +36,7 @@ public class {{classname}}Test {
|
||||
{{#allParams}}
|
||||
{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.Resource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class ApiClient {
|
||||
auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
{{/isOAuth}}
|
||||
} else {{/authMethods}}{
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
|
@ -38,6 +38,6 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
||||
|
@ -36,8 +36,8 @@ public interface {{classname}} {
|
||||
{{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}}
|
||||
@{{httpMethod}}("{{{path}}}")
|
||||
{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}
|
||||
);{{/hasMore}}{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{^-last}}, {{/-last}}{{#-last}}
|
||||
);{{/-last}}{{/allParams}}
|
||||
|
||||
/**
|
||||
* {{summary}}
|
||||
|
@ -36,7 +36,7 @@ public class {{classname}}Test {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class ApiClient {
|
||||
auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}");
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{#hasMore}}, {{/hasMore}}{{/scopes}}");
|
||||
auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}");
|
||||
{{/isOAuth}}
|
||||
} else {{/authMethods}}{
|
||||
throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names");
|
||||
|
@ -34,6 +34,6 @@ After the client library is installed/deployed, you can use it in your Maven pro
|
||||
|
||||
## Author
|
||||
|
||||
{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}}
|
||||
{{/hasMore}}{{/apis}}{{/apiInfo}}
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}}
|
||||
{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
|
||||
|
@ -75,8 +75,8 @@ public interface {{classname}} {
|
||||
{{/formParams}}
|
||||
@{{httpMethod}}("{{{path}}}")
|
||||
{{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}
|
||||
);{{/hasMore}}{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}
|
||||
);{{/-last}}{{/allParams}}
|
||||
|
||||
{{/operation}}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class {{classname}}Test {
|
||||
{{#allParams}}
|
||||
{{{dataType}}} {{paramName}} = null;
|
||||
{{/allParams}}
|
||||
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
// {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
@ -51,8 +51,8 @@ public interface {{classname}} {
|
||||
{{/formParams}}
|
||||
@{{httpMethod}}("{{{path}}}")
|
||||
F.Promise<Response<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>> {{operationId}}({{^allParams}});{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}
|
||||
);{{/hasMore}}{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}
|
||||
);{{/-last}}{{/allParams}}
|
||||
|
||||
{{/operation}}
|
||||
}
|
||||
|
@ -51,8 +51,8 @@ public interface {{classname}} {
|
||||
{{/formParams}}
|
||||
@{{httpMethod}}("{{{path}}}")
|
||||
CompletionStage<Response<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>> {{operationId}}({{^allParams}});{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}
|
||||
);{{/hasMore}}{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}
|
||||
);{{/-last}}{{/allParams}}
|
||||
|
||||
{{/operation}}
|
||||
}
|
||||
|
@ -51,8 +51,8 @@ public interface {{classname}} {
|
||||
{{/formParams}}
|
||||
@{{httpMethod}}("{{{path}}}")
|
||||
CompletionStage<Response<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>> {{operationId}}({{^allParams}});{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}
|
||||
);{{/hasMore}}{{/allParams}}
|
||||
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}
|
||||
);{{/-last}}{{/allParams}}
|
||||
|
||||
{{/operation}}
|
||||
}
|
||||
|
@ -100,9 +100,9 @@ public class {{classname}}Impl implements {{classname}} {
|
||||
{{#formParams}}if ({{paramName}} != null) localVarFormParams.put("{{baseName}}", {{paramName}});
|
||||
{{/formParams}}
|
||||
|
||||
String[] localVarAccepts = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} };
|
||||
String[] localVarContentTypes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} };
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
|
||||
String[] localVarAccepts = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} };
|
||||
String[] localVarContentTypes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} };
|
||||
String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
|
||||
{{#returnType}}
|
||||
TypeReference<{{{returnType}}}> localVarReturnType = new TypeReference<{{{returnType}}}>() {};
|
||||
apiClient.invokeAPI(localVarPath, "{{httpMethod}}", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, authInfo, localVarReturnType, resultHandler);{{/returnType}}{{^returnType}}
|
||||
|
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