Merge remote-tracking branch 'origin' into 4.0.x

This commit is contained in:
William Cheng
2018-11-24 17:48:17 +08:00
447 changed files with 17976 additions and 1104 deletions

View File

@@ -27,6 +27,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby -DskipFormModel=true $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/openapi3/client/petstore/ruby -DskipFormModel=true $@"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -11,6 +11,7 @@ sleep 5
# LIST OF SCRIPTS:
declare -a scripts=("./bin/openapi3/ruby-client-petstore.sh"
"./bin/ruby-client-petstore.sh"
"./bin/java-petstore-all.sh"
"./bin/java-jaxrs-petstore-server-all.sh"
"./bin/openapi3/jaxrs-jersey-petstore.sh"

View File

@@ -27,11 +27,12 @@ public class CodegenParameter {
isCookieParam, isBodyParam, hasMore, isContainer,
secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel;
public String baseName, paramName, dataType, datatypeWithEnum, dataFormat,
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName;
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName;
public String example; // example value (x-example)
public String jsonSchema;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isEmail;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary,
isBoolean, isDate, isDateTime, isUuid, isEmail, isFreeFormObject;
public boolean isListContainer, isMapContainer;
public boolean isFile;
public boolean isEnum;
@@ -148,7 +149,7 @@ public class CodegenParameter {
if (this.mostInnerItems != null) {
output.mostInnerItems = this.mostInnerItems;
}
if(this.vendorExtensions != null){
if (this.vendorExtensions != null) {
output.vendorExtensions = new HashMap<String, Object>(this.vendorExtensions);
}
output.hasValidation = this.hasValidation;
@@ -167,6 +168,7 @@ public class CodegenParameter {
output.isDateTime = this.isDateTime;
output.isUuid = this.isUuid;
output.isEmail = this.isEmail;
output.isFreeFormObject = this.isFreeFormObject;
output.isListContainer = this.isListContainer;
output.isMapContainer = this.isMapContainer;
@@ -259,6 +261,8 @@ public class CodegenParameter {
return false;
if (isEmail != that.isEmail)
return false;
if (isFreeFormObject != that.isFreeFormObject)
return false;
if (isListContainer != that.isListContainer)
return false;
if (isMapContainer != that.isMapContainer)
@@ -307,18 +311,18 @@ public class CodegenParameter {
@Override
public int hashCode() {
int result = isFormParam ? 13:31;
result = 31 * result + (isQueryParam ? 13:31);
result = 31 * result + (isPathParam ? 13:31);
result = 31 * result + (isHeaderParam ? 13:31);
result = 31 * result + (isCookieParam ? 13:31);
result = 31 * result + (isBodyParam ? 13:31);
result = 31 * result + (hasMore ? 13:31);
result = 31 * result + (isContainer ? 13:31);
result = 31 * result + (secondaryParam ? 13:31);
result = 31 * result + (isCollectionFormatMulti ? 13:31);
result = 31 * result + (isPrimitiveType ? 13:31);
result = 31 * result + (isModel ? 13:31);
int result = isFormParam ? 13 : 31;
result = 31 * result + (isQueryParam ? 13 : 31);
result = 31 * result + (isPathParam ? 13 : 31);
result = 31 * result + (isHeaderParam ? 13 : 31);
result = 31 * result + (isCookieParam ? 13 : 31);
result = 31 * result + (isBodyParam ? 13 : 31);
result = 31 * result + (hasMore ? 13 : 31);
result = 31 * result + (isContainer ? 13 : 31);
result = 31 * result + (secondaryParam ? 13 : 31);
result = 31 * result + (isCollectionFormatMulti ? 13 : 31);
result = 31 * result + (isPrimitiveType ? 13 : 31);
result = 31 * result + (isModel ? 13 : 31);
result = 31 * result + (baseName != null ? baseName.hashCode() : 0);
result = 31 * result + (paramName != null ? paramName.hashCode() : 0);
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
@@ -332,42 +336,43 @@ public class CodegenParameter {
result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0);
result = 31 * result + (example != null ? example.hashCode() : 0);
result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0);
result = 31 * result + (isString ? 13:31);
result = 31 * result + (isNumeric ? 13:31);
result = 31 * result + (isInteger ? 13:31);
result = 31 * result + (isLong ? 13:31);
result = 31 * result + (isFloat ? 13:31);
result = 31 * result + (isNumber ? 13:31);
result = 31 * result + (isDouble ? 13:31);
result = 31 * result + (isByteArray ? 13:31);
result = 31 * result + (isBinary ? 13:31);
result = 31 * result + (isBoolean ? 13:31);
result = 31 * result + (isDate ? 13:31);
result = 31 * result + (isDateTime ? 13:31);
result = 31 * result + (isUuid ? 13:31);
result = 31 * result + (isEmail ? 13:31);
result = 31 * result + (isListContainer ? 13:31);
result = 31 * result + (isMapContainer ? 13:31);
result = 31 * result + (isFile ? 13:31);
result = 31 * result + (isString ? 13 : 31);
result = 31 * result + (isNumeric ? 13 : 31);
result = 31 * result + (isInteger ? 13 : 31);
result = 31 * result + (isLong ? 13 : 31);
result = 31 * result + (isFloat ? 13 : 31);
result = 31 * result + (isNumber ? 13 : 31);
result = 31 * result + (isDouble ? 13 : 31);
result = 31 * result + (isByteArray ? 13 : 31);
result = 31 * result + (isBinary ? 13 : 31);
result = 31 * result + (isBoolean ? 13 : 31);
result = 31 * result + (isDate ? 13 : 31);
result = 31 * result + (isDateTime ? 13 : 31);
result = 31 * result + (isUuid ? 13 : 31);
result = 31 * result + (isEmail ? 13 : 31);
result = 31 * result + (isFreeFormObject ? 13 : 31);
result = 31 * result + (isListContainer ? 13 : 31);
result = 31 * result + (isMapContainer ? 13 : 31);
result = 31 * result + (isFile ? 13 : 31);
result = 31 * result + (isEnum ? 1 : 0);
result = 31 * result + (_enum != null ? _enum.hashCode() : 0);
result = 31 * result + (allowableValues != null ? allowableValues.hashCode() : 0);
result = 31 * result + (items != null ? items.hashCode() : 0);
result = 31 * result + (mostInnerItems != null ? mostInnerItems.hashCode() : 0);
result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
result = 31 * result + (hasValidation ? 13:31);
result = 31 * result + (isNullable ? 13:31);
result = 31 * result + (required ? 13:31);
result = 31 * result + (hasValidation ? 13 : 31);
result = 31 * result + (isNullable ? 13 : 31);
result = 31 * result + (required ? 13 : 31);
result = 31 * result + (maximum != null ? maximum.hashCode() : 0);
result = 31 * result + (exclusiveMaximum ? 13:31);
result = 31 * result + (exclusiveMaximum ? 13 : 31);
result = 31 * result + (minimum != null ? minimum.hashCode() : 0);
result = 31 * result + (exclusiveMinimum ? 13:31);
result = 31 * result + (exclusiveMinimum ? 13 : 31);
result = 31 * result + (maxLength != null ? maxLength.hashCode() : 0);
result = 31 * result + (minLength != null ? minLength.hashCode() : 0);
result = 31 * result + (pattern != null ? pattern.hashCode() : 0);
result = 31 * result + (maxItems != null ? maxItems.hashCode() : 0);
result = 31 * result + (minItems != null ? minItems.hashCode() : 0);
result = 31 * result + (uniqueItems ? 13:31);
result = 31 * result + (uniqueItems ? 13 : 31);
result = 31 * result + (multipleOf != null ? multipleOf.hashCode() : 0);
return result;
}
@@ -414,6 +419,7 @@ public class CodegenParameter {
", isDateTime=" + isDateTime +
", isUuid=" + isUuid +
", isEmail=" + isEmail +
", isFreeFormObject=" + isFreeFormObject +
", isListContainer=" + isListContainer +
", isMapContainer=" + isMapContainer +
", isFile=" + isFile +

View File

@@ -25,10 +25,12 @@ import java.util.Objects;
public class CodegenProperty implements Cloneable {
public String baseName, complexType, getter, setter, description, dataType,
datatypeWithEnum, dataFormat, name, min, max, defaultValue, defaultValueWithParam,
baseType, containerType, title;
datatypeWithEnum, dataFormat, name, min, max, defaultValue, defaultValueWithParam,
baseType, containerType, title;
/** The 'description' string without escape charcters needed by some programming languages/targets */
/**
* The 'description' string without escape charcters needed by some programming languages/targets
*/
public String unescapedDescription;
/**
@@ -56,7 +58,8 @@ public class CodegenProperty implements Cloneable {
public boolean hasMore, required, secondaryParam;
public boolean hasMoreNonReadOnly; // for model constructor, true if next property is not readonly
public boolean isPrimitiveType, isModel, isContainer, isNotContainer;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile, isBoolean, isDate, isDateTime, isUuid, isEmail;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile,
isBoolean, isDate, isDateTime, isUuid, isEmail, isFreeFormObject;
public boolean isListContainer, isMapContainer;
public boolean isEnum;
public boolean isReadOnly;
@@ -84,7 +87,7 @@ public class CodegenProperty implements Cloneable {
public String xmlNamespace;
public boolean isXmlWrapped = false;
public String getBaseName() {
public String getBaseName() {
return baseName;
}
@@ -125,9 +128,9 @@ public class CodegenProperty implements Cloneable {
}
/**
* @return dataType
* @deprecated since version 3.0.0, use {@link #getDataType()} instead.<br>
* May be removed with the next major release (4.0)
* @return dataType
*/
@Deprecated
public String getDatatype() {
@@ -411,8 +414,7 @@ public class CodegenProperty implements Cloneable {
}
@Override
public int hashCode()
{
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((_enum == null) ? 0 : _enum.hashCode());
@@ -429,19 +431,19 @@ public class CodegenProperty implements Cloneable {
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
result = prime * result + ((example == null) ? 0 : example.hashCode());
result = prime * result + (exclusiveMaximum ? 13:31);
result = prime * result + (exclusiveMinimum ? 13:31);
result = prime * result + (exclusiveMaximum ? 13 : 31);
result = prime * result + (exclusiveMinimum ? 13 : 31);
result = prime * result + ((getter == null) ? 0 : getter.hashCode());
result = prime * result + (hasMore ? 13:31);
result = prime * result + ((hasMoreNonReadOnly ? 13:31));
result = prime * result + ((isContainer ? 13:31));
result = prime * result + (hasMore ? 13 : 31);
result = prime * result + ((hasMoreNonReadOnly ? 13 : 31));
result = prime * result + ((isContainer ? 13 : 31));
result = prime * result + (isEnum ? 1231 : 1237);
result = prime * result + ((isNotContainer ? 13:31));
result = prime * result + ((isPrimitiveType ? 13:31));
result = prime * result + ((isModel ? 13:31));
result = prime * result + ((isReadOnly ? 13:31));
result = prime * result + ((isWriteOnly ? 13:31));
result = prime * result + ((isNullable ? 13:31));
result = prime * result + ((isNotContainer ? 13 : 31));
result = prime * result + ((isPrimitiveType ? 13 : 31));
result = prime * result + ((isModel ? 13 : 31));
result = prime * result + ((isReadOnly ? 13 : 31));
result = prime * result + ((isWriteOnly ? 13 : 31));
result = prime * result + ((isNullable ? 13 : 31));
result = prime * result + ((items == null) ? 0 : items.hashCode());
result = prime * result + ((mostInnerItems == null) ? 0 : mostInnerItems.hashCode());
result = prime * result + ((jsonSchema == null) ? 0 : jsonSchema.hashCode());
@@ -453,29 +455,30 @@ public class CodegenProperty implements Cloneable {
result = prime * result + ((minimum == null) ? 0 : minimum.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((pattern == null) ? 0 : pattern.hashCode());
result = prime * result + ((required ? 13:31));
result = prime * result + ((secondaryParam ? 13:31));
result = prime * result + ((required ? 13 : 31));
result = prime * result + ((secondaryParam ? 13 : 31));
result = prime * result + ((setter == null) ? 0 : setter.hashCode());
result = prime * result + ((unescapedDescription == null) ? 0 : unescapedDescription.hashCode());
result = prime * result + ((vendorExtensions == null) ? 0 : vendorExtensions.hashCode());
result = prime * result + ((hasValidation ? 13:31));
result = prime * result + ((isString ? 13:31));
result = prime * result + ((isNumeric ? 13:31));
result = prime * result + ((isInteger ? 13:31));
result = prime * result + ((isLong ?13:31));
result = prime * result + ((isNumber ? 13:31));
result = prime * result + ((isFloat ? 13:31));
result = prime * result + ((isDouble ? 13:31));
result = prime * result + ((isByteArray ? 13:31));
result = prime * result + ((isBinary ? 13:31));
result = prime * result + ((isFile ? 13:31));
result = prime * result + ((isBoolean ? 13:31));
result = prime * result + ((isDate ? 13:31));
result = prime * result + ((isDateTime ? 13:31));
result = prime * result + ((isUuid ? 13:31));
result = prime * result + ((isEmail ? 13:31));
result = prime * result + ((isMapContainer ? 13:31));
result = prime * result + ((isListContainer ? 13:31));
result = prime * result + ((hasValidation ? 13 : 31));
result = prime * result + ((isString ? 13 : 31));
result = prime * result + ((isNumeric ? 13 : 31));
result = prime * result + ((isInteger ? 13 : 31));
result = prime * result + ((isLong ? 13 : 31));
result = prime * result + ((isNumber ? 13 : 31));
result = prime * result + ((isFloat ? 13 : 31));
result = prime * result + ((isDouble ? 13 : 31));
result = prime * result + ((isByteArray ? 13 : 31));
result = prime * result + ((isBinary ? 13 : 31));
result = prime * result + ((isFile ? 13 : 31));
result = prime * result + ((isBoolean ? 13 : 31));
result = prime * result + ((isDate ? 13 : 31));
result = prime * result + ((isDateTime ? 13 : 31));
result = prime * result + ((isUuid ? 13 : 31));
result = prime * result + ((isEmail ? 13 : 31));
result = prime * result + ((isFreeFormObject ? 13 : 31));
result = prime * result + ((isMapContainer ? 13 : 31));
result = prime * result + ((isListContainer ? 13 : 31));
result = prime * result + Objects.hashCode(isInherited);
result = prime * result + Objects.hashCode(discriminatorValue);
result = prime * result + Objects.hashCode(nameInCamelCase);
@@ -483,11 +486,11 @@ public class CodegenProperty implements Cloneable {
result = prime * result + Objects.hashCode(enumName);
result = prime * result + ((maxItems == null) ? 0 : maxItems.hashCode());
result = prime * result + ((minItems == null) ? 0 : minItems.hashCode());
result = prime * result + ((isXmlAttribute ? 13:31));
result = prime * result + ((isXmlAttribute ? 13 : 31));
result = prime * result + ((xmlPrefix == null) ? 0 : xmlPrefix.hashCode());
result = prime * result + ((xmlName == null) ? 0 : xmlName.hashCode());
result = prime * result + ((xmlNamespace == null) ? 0 : xmlNamespace.hashCode());
result = prime * result + ((isXmlWrapped ? 13:31));
result = prime * result + ((isXmlWrapped ? 13 : 31));
return result;
}
@@ -657,6 +660,9 @@ public class CodegenProperty implements Cloneable {
if (this.isEmail != other.isEmail) {
return false;
}
if (this.isFreeFormObject != other.isFreeFormObject) {
return false;
}
if (this.isBinary != other.isBinary) {
return false;
}
@@ -724,7 +730,7 @@ public class CodegenProperty implements Cloneable {
if (this.mostInnerItems != null) {
cp.mostInnerItems = this.mostInnerItems;
}
if(this.vendorExtensions != null){
if (this.vendorExtensions != null) {
cp.vendorExtensions = new HashMap<String, Object>(this.vendorExtensions);
}
return cp;
@@ -785,11 +791,12 @@ public class CodegenProperty implements Cloneable {
", isDateTime=" + isDateTime +
", isUuid=" + isUuid +
", isEmail=" + isEmail +
", isFreeFormObject=" + isFreeFormObject +
", isListContainer=" + isListContainer +
", isMapContainer=" + isMapContainer +
", isEnum=" + isEnum +
", isReadOnly=" + isReadOnly +
", isWriteOnly=" + isWriteOnly+
", isWriteOnly=" + isWriteOnly +
", isNullable=" + isNullable +
", _enum=" + _enum +
", allowableValues=" + allowableValues +

View File

@@ -17,11 +17,7 @@
package org.openapitools.codegen;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.*;
public class CodegenResponse {
public final List<CodegenProperty> headers = new ArrayList<CodegenProperty>();
@@ -30,7 +26,8 @@ public class CodegenResponse {
public List<Map<String, Object>> examples;
public String dataType, baseType, containerType;
public boolean hasHeaders;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate, isDateTime, isUuid, isEmail;
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate,
isDateTime, isUuid, isEmail, isModel, isFreeFormObject;
public boolean isDefault;
public boolean simpleType;
public boolean primitiveType;
@@ -48,76 +45,90 @@ public class CodegenResponse {
@Override
public String toString() {
return String.format(Locale.ROOT, "%s(%s)", code, containerType);
return "CodegenResponse{" +
"headers=" + headers +
", code='" + code + '\'' +
", message='" + message + '\'' +
", hasMore=" + hasMore +
", examples=" + examples +
", dataType='" + dataType + '\'' +
", baseType='" + baseType + '\'' +
", containerType='" + containerType + '\'' +
", hasHeaders=" + hasHeaders +
", isString=" + isString +
", isNumeric=" + isNumeric +
", isInteger=" + isInteger +
", isLong=" + isLong +
", isNumber=" + isNumber +
", isFloat=" + isFloat +
", isDouble=" + isDouble +
", isByteArray=" + isByteArray +
", isBoolean=" + isBoolean +
", isDate=" + isDate +
", isDateTime=" + isDateTime +
", isUuid=" + isUuid +
", isEmail=" + isEmail +
", isFreeFormObject=" + isFreeFormObject +
", isModel=" + isModel +
", isDefault=" + isDefault +
", simpleType=" + simpleType +
", primitiveType=" + primitiveType +
", isMapContainer=" + isMapContainer +
", isListContainer=" + isListContainer +
", isBinary=" + isBinary +
", isFile=" + isFile +
", schema=" + schema +
", jsonSchema='" + jsonSchema + '\'' +
", vendorExtensions=" + vendorExtensions +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CodegenResponse that = (CodegenResponse) o;
if (!headers.equals(that.headers))
return false;
if (code != null ? !code.equals(that.code) : that.code != null)
return false;
if (message != null ? !message.equals(that.message) : that.message != null)
return false;
if (hasMore != that.hasMore)
return false;
if (examples != null ? !examples.equals(that.examples) : that.examples != null)
return false;
if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null)
return false;
if (baseType != null ? !baseType.equals(that.baseType) : that.baseType != null)
return false;
if (containerType != null ? !containerType.equals(that.containerType) : that.containerType != null)
return false;
if (isDefault != that.isDefault)
return false;
if (simpleType != that.simpleType)
return false;
if (primitiveType != that.primitiveType)
return false;
if (isMapContainer != that.isMapContainer)
return false;
if (isListContainer != that.isListContainer)
return false;
if (isBinary != that.isBinary)
return false;
if (isFile != that.isFile)
return false;
if (isNumeric != that.isNumeric)
return false;
if (schema != null ? !schema.equals(that.schema) : that.schema != null)
return false;
if (vendorExtensions != null ? !vendorExtensions.equals(that.vendorExtensions) : that.vendorExtensions != null)
return false;
return jsonSchema != null ? jsonSchema.equals(that.jsonSchema) : that.jsonSchema == null;
return hasMore == that.hasMore &&
hasHeaders == that.hasHeaders &&
isString == that.isString &&
isNumeric == that.isNumeric &&
isInteger == that.isInteger &&
isLong == that.isLong &&
isNumber == that.isNumber &&
isFloat == that.isFloat &&
isDouble == that.isDouble &&
isByteArray == that.isByteArray &&
isBoolean == that.isBoolean &&
isDate == that.isDate &&
isDateTime == that.isDateTime &&
isUuid == that.isUuid &&
isEmail == that.isEmail &&
isFreeFormObject == that.isFreeFormObject &&
isModel == that.isModel &&
isDefault == that.isDefault &&
simpleType == that.simpleType &&
primitiveType == that.primitiveType &&
isMapContainer == that.isMapContainer &&
isListContainer == that.isListContainer &&
isBinary == that.isBinary &&
isFile == that.isFile &&
Objects.equals(headers, that.headers) &&
Objects.equals(code, that.code) &&
Objects.equals(message, that.message) &&
Objects.equals(examples, that.examples) &&
Objects.equals(dataType, that.dataType) &&
Objects.equals(baseType, that.baseType) &&
Objects.equals(containerType, that.containerType) &&
Objects.equals(schema, that.schema) &&
Objects.equals(jsonSchema, that.jsonSchema) &&
Objects.equals(vendorExtensions, that.vendorExtensions);
}
@Override
public int hashCode() {
int result = headers.hashCode();
result = 31 * result + (code != null ? code.hashCode() : 0);
result = 31 * result + (message != null ? message.hashCode() : 0);
result = 31 * result + (hasMore ? 13:31);
result = 31 * result + (examples != null ? examples.hashCode() : 0);
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
result = 31 * result + (baseType != null ? baseType.hashCode() : 0);
result = 31 * result + (containerType != null ? containerType.hashCode() : 0);
result = 31 * result + (isDefault ? 13:31);
result = 31 * result + (isNumeric ? 13:31);
result = 31 * result + (simpleType ? 13:31);
result = 31 * result + (primitiveType ? 13:31);
result = 31 * result + (isMapContainer ? 13:31);
result = 31 * result + (isListContainer ? 13:31);
result = 31 * result + (isBinary ? 13:31);
result = 31 * result + (isFile ? 13:31);
result = 31 * result + (schema != null ? schema.hashCode() : 0);
result = 31 * result + (jsonSchema != null ? jsonSchema.hashCode() : 0);
result = 31 * result + (vendorExtensions != null ? vendorExtensions.hashCode() : 0);
return result;
return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, hasHeaders,
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate,
isDateTime, isUuid, isEmail, isFreeFormObject, isModel, isDefault, simpleType, primitiveType, isMapContainer,
isListContainer, isBinary, isFile, schema, jsonSchema, vendorExtensions);
}
}

View File

@@ -1152,6 +1152,8 @@ public class DefaultCodegen implements CodegenConfig {
codegenParameter.example = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
} else if (Boolean.TRUE.equals(codegenParameter.isString)) {
codegenParameter.example = codegenParameter.paramName + "_example";
} else if (Boolean.TRUE.equals(codegenParameter.isFreeFormObject)) {
codegenParameter.example = "Object";
}
}
@@ -1375,6 +1377,8 @@ public class DefaultCodegen implements CodegenConfig {
return "UUID";
} else if (ModelUtils.isStringSchema(schema)) {
return "string";
} else if (ModelUtils.isFreeFormObject(schema)) {
return "object";
} else if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { // having property implies it's a model
return "object";
} else if (StringUtils.isNotEmpty(schema.getType())) {
@@ -1685,7 +1689,8 @@ public class DefaultCodegen implements CodegenConfig {
return m;
}
private CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, Map<String, Schema> allDefinitions) {
private CodegenDiscriminator createDiscriminator(String schemaName, Schema
schema, Map<String, Schema> allDefinitions) {
if (schema.getDiscriminator() == null) {
return null;
}
@@ -1717,7 +1722,8 @@ public class DefaultCodegen implements CodegenConfig {
addParentContainer(codegenModel, codegenModel.name, schema);
}
protected void addProperties(Map<String, Schema> properties, List<String> required, Schema schema, Map<String, Schema> allSchemas) {
protected void addProperties(Map<String, Schema> properties, List<String> required, Schema
schema, Map<String, Schema> allSchemas) {
if (schema instanceof ComposedSchema) {
ComposedSchema composedSchema = (ComposedSchema) schema;
if (composedSchema.getAllOf() == null) {
@@ -2010,6 +2016,9 @@ public class DefaultCodegen implements CodegenConfig {
// handle inner property
CodegenProperty cp = fromProperty("inner", ModelUtils.getAdditionalProperties(p));
updatePropertyForMap(property, cp);
} else if (ModelUtils.isFreeFormObject(p)) {
property.isFreeFormObject = true;
property.baseType = getSchemaType(p);
} else { // model
// TODO revise the logic below
//if (StringUtils.isNotBlank(p.get$ref())) {
@@ -2212,7 +2221,8 @@ public class DefaultCodegen implements CodegenConfig {
* @param schemas a map of OAS models
* @return Codegen Operation object
*/
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map<String, Schema> schemas) {
public CodegenOperation fromOperation(String path, String httpMethod, Operation
operation, Map<String, Schema> schemas) {
return fromOperation(path, httpMethod, operation, schemas, null);
}
@@ -2576,6 +2586,7 @@ public class DefaultCodegen implements CodegenConfig {
} else {
if (cp.complexType != null) {
r.baseType = cp.complexType;
r.isModel = true;
} else {
r.baseType = cp.baseType;
}
@@ -2616,6 +2627,8 @@ public class DefaultCodegen implements CodegenConfig {
r.isDate = true;
} else if (Boolean.TRUE.equals(cp.isDateTime)) {
r.isDateTime = true;
} else if (Boolean.TRUE.equals(cp.isFreeFormObject)) {
r.isFreeFormObject = true;
} else {
LOGGER.debug("Property type is not primitive: " + cp.dataType);
}
@@ -2651,7 +2664,8 @@ public class DefaultCodegen implements CodegenConfig {
* @param openAPI a OAS object representing the spec
* @return Codegen Response object
*/
public CodegenCallback fromCallback(String name, Callback callback, Map<String, Schema> schemas, OpenAPI openAPI) {
public CodegenCallback fromCallback(String name, Callback callback, Map<String, Schema> schemas, OpenAPI
openAPI) {
CodegenCallback c = new CodegenCallback();
c.name = name;
@@ -3227,7 +3241,8 @@ public class DefaultCodegen implements CodegenConfig {
* @param operations map of Codegen operations
*/
@SuppressWarnings("static-method")
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map<String, List<CodegenOperation>> operations) {
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation
co, Map<String, List<CodegenOperation>> operations) {
List<CodegenOperation> opList = operations.get(tag);
if (opList == null) {
opList = new ArrayList<CodegenOperation>();
@@ -3334,7 +3349,8 @@ public class DefaultCodegen implements CodegenConfig {
* @param properties model properties (schemas)
* @return model properties with direct reference to schemas
*/
private Map<String, Schema> unaliasPropertySchema(Map<String, Schema> allSchemas, Map<String, Schema> properties) {
private Map<String, Schema> unaliasPropertySchema
(Map<String, Schema> allSchemas, Map<String, Schema> properties) {
if (properties != null) {
for (String key : properties.keySet()) {
properties.put(key, ModelUtils.unaliasSchema(allSchemas, properties.get(key)));
@@ -3375,7 +3391,8 @@ public class DefaultCodegen implements CodegenConfig {
}
}
private void addVars(CodegenModel m, List<CodegenProperty> vars, Map<String, Schema> properties, Set<String> mandatory) {
private void addVars(CodegenModel
m, List<CodegenProperty> vars, Map<String, Schema> properties, Set<String> mandatory) {
// convert set to list so that we can access the next entry in the loop
List<Map.Entry<String, Schema>> propertyList = new ArrayList<Map.Entry<String, Schema>>(properties.entrySet());
final int totalCount = propertyList.size();
@@ -3888,6 +3905,8 @@ public class DefaultCodegen implements CodegenConfig {
} else if (Boolean.TRUE.equals(property.isDateTime)) {
parameter.isDateTime = true;
parameter.isPrimitiveType = true;
} else if (Boolean.TRUE.equals(property.isFreeFormObject)) {
parameter.isFreeFormObject = true;
} else {
LOGGER.debug("Property type is not primitive: " + property.dataType);
}
@@ -3961,7 +3980,8 @@ public class DefaultCodegen implements CodegenConfig {
}
}
private void updateEnumVarsWithExtensions(List<Map<String, Object>> enumVars, Map<String, Object> vendorExtensions) {
private void updateEnumVarsWithExtensions
(List<Map<String, Object>> enumVars, Map<String, Object> vendorExtensions) {
if (vendorExtensions != null && vendorExtensions.containsKey("x-enum-varnames")) {
List<String> alias = (List<String>) vendorExtensions.get("x-enum-varnames");
int size = Math.min(enumVars.size(), alias.size());
@@ -4272,7 +4292,8 @@ public class DefaultCodegen implements CodegenConfig {
return null;
}
public List<CodegenParameter> fromRequestBodyToFormParameters(RequestBody body, Map<String, Schema> schemas, Set<String> imports) {
public List<CodegenParameter> fromRequestBodyToFormParameters(RequestBody
body, Map<String, Schema> schemas, Set<String> imports) {
List<CodegenParameter> parameters = new ArrayList<CodegenParameter>();
LOGGER.debug("debugging fromRequestBodyToFormParameters= " + body);
Schema schema = ModelUtils.getSchemaFromRequestBody(body);
@@ -4428,7 +4449,8 @@ public class DefaultCodegen implements CodegenConfig {
return codegenParameter;
}
public CodegenParameter fromRequestBody(RequestBody body, Map<String, Schema> schemas, Set<String> imports, String bodyParameterName) {
public CodegenParameter fromRequestBody(RequestBody
body, Map<String, Schema> schemas, Set<String> imports, String bodyParameterName) {
if (body == null) {
LOGGER.error("body in fromRequestBody cannot be null!");
}
@@ -4735,7 +4757,7 @@ public class DefaultCodegen implements CodegenConfig {
/**
* Set the boolean value indicating the state of the option for post-processing file using envirionment variables.
*
* @param enablePostProcessFile true to enable post-processing file
* @param enablePostProcessFile true to enable post-processing file
*/
public void setEnablePostProcessFile(boolean enablePostProcessFile) {
this.enablePostProcessFile = enablePostProcessFile;

View File

@@ -285,8 +285,8 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation op : operationList) {
for(String hdr : op.imports) {
if(importMapping.containsKey(hdr)) {
for (String hdr : op.imports) {
if (importMapping.containsKey(hdr)) {
continue;
}
operations.put("hasModelImport", true);
@@ -411,7 +411,6 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
@Override
public Map<String, Object> postProcessAllModels(final Map<String, Object> models) {
final Map<String, Object> processed = super.postProcessAllModels(models);
postProcessParentModels(models);
return processed;
@@ -432,13 +431,18 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen {
*/
private void processParentPropertiesInChildModel(final CodegenModel parent, final CodegenModel child) {
final Map<String, CodegenProperty> childPropertiesByName = new HashMap<>(child.vars.size());
for (final CodegenProperty childSchema : child.vars) {
childPropertiesByName.put(childSchema.name, childSchema);
if (child != null && child.vars != null && !child.vars.isEmpty()) {
for (final CodegenProperty childSchema : child.vars) {
childPropertiesByName.put(childSchema.name, childSchema);
}
}
for (final CodegenProperty parentSchema : parent.vars) {
final CodegenProperty duplicatedByParent = childPropertiesByName.get(parentSchema.name);
if (duplicatedByParent != null) {
duplicatedByParent.isInherited = true;
if (parent != null && parent.vars != null && !parent.vars.isEmpty()) {
for (final CodegenProperty parentSchema : parent.vars) {
final CodegenProperty duplicatedByParent = childPropertiesByName.get(parentSchema.name);
if (duplicatedByParent != null) {
duplicatedByParent.isInherited = true;
}
}
}
}

View File

@@ -169,7 +169,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
typeMapping.put("map", "Map");
typeMapping.put("array", "List");
typeMapping.put("list", "List");
// typeMapping.put("object", "Map");
typeMapping.put("object", "Map");
typeMapping.put("binary", "String");
typeMapping.put("ByteArray", "String");
typeMapping.put("UUID", "String");
@@ -431,7 +431,19 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig
throw new RuntimeException("Empty method name (operationId) not allowed");
}
return org.openapitools.codegen.utils.StringUtils.camelize(sanitizeName(operationId));
// method name cannot use reserved keyword, e.g. return
if (isReservedWord(operationId)) {
LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + org.openapitools.codegen.utils.StringUtils.underscore(sanitizeName("call_" + operationId)));
return org.openapitools.codegen.utils.StringUtils.underscore(sanitizeName("call_" + operationId));
}
// operationId starts with a number
if (operationId.matches("^\\d.*")) {
LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + org.openapitools.codegen.utils.StringUtils.underscore(sanitizeName("call_" + operationId)));
operationId = "call_" + operationId;
}
return org.openapitools.codegen.utils.StringUtils.underscore(sanitizeName(operationId));
}
/**

View File

@@ -66,7 +66,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final String ENCODER = "elmEncoder";
private static final String DECODER = "elmDecoder";
private static final String DISCRIMINATOR_NAME = "discriminatorName";
private static final String UNION_TYPE = "elmUnionType";
private static final String CUSTOM_TYPE = "elmCustomType";
protected String packageName = "openapi";
protected String packageVersion = "1.0.0";
@@ -122,6 +122,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
"Dict",
"Float",
"Int",
"List",
"String")
);
@@ -353,7 +354,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
CodegenModel cm = (CodegenModel) mo.get("model");
if (cm.isEnum) {
addEncoderAndDecoder(cm.vendorExtensions, cm.classname, DataTypeExposure.EXPOSED);
cm.vendorExtensions.put(UNION_TYPE, cm.classname);
cm.vendorExtensions.put(CUSTOM_TYPE, cm.classname);
} else if (cm.isAlias) {
addEncoderAndDecoder(cm.vendorExtensions, cm.dataType, DataTypeExposure.EXPOSED);
}
@@ -621,7 +622,7 @@ public class ElmClientCodegen extends DefaultCodegen implements CodegenConfig {
if (property.isEnum) {
addEncoderAndDecoder(property.vendorExtensions, property.baseName, DataTypeExposure.INTERNAL);
property.vendorExtensions.put(UNION_TYPE, property.datatypeWithEnum);
property.vendorExtensions.put(CUSTOM_TYPE, property.datatypeWithEnum);
} else {
final boolean isPrimitiveType = property.isMapContainer ? isPrimitiveDataType(property.dataType) : property.isPrimitiveType;
addEncoderAndDecoder(property.vendorExtensions, property.dataType, isPrimitiveType ? DataTypeExposure.PRIMITIVE : DataTypeExposure.EXTERNAL);

View File

@@ -891,7 +891,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
if (appendDataType
&& uniqueParamNameTypes.containsKey(paramNameType)
&& !isDuplicate(paramNameType, dataType)) {
paramNameType = paramNameType + dataType;
paramNameType = toTypeName("", paramNameType + dataType);
}
while (typeNames.contains(paramNameType)) {

View File

@@ -297,7 +297,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
}
if (projectDescription == null) {
// when projectDescription is not specified, use info.description
projectDescription = sanitizeName(info.getDescription());
if (StringUtils.isEmpty(info.getDescription())) {
projectDescription = "JS API client generated by OpenAPI Generator";
} else {
projectDescription = sanitizeName(info.getDescription());
}
}
// when licenceName is not specified, use info.license
@@ -506,13 +510,18 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
private String getNameUsingModelPropertyNaming(String name) {
switch (CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.valueOf(getModelPropertyNaming())) {
case original: return name;
case camelCase: return org.openapitools.codegen.utils.StringUtils.camelize(name, true);
case PascalCase: return org.openapitools.codegen.utils.StringUtils.camelize(name);
case snake_case: return org.openapitools.codegen.utils.StringUtils.underscore(name);
default: throw new IllegalArgumentException("Invalid model property naming '" +
name + "'. Must be 'original', 'camelCase', " +
"'PascalCase' or 'snake_case'");
case original:
return name;
case camelCase:
return org.openapitools.codegen.utils.StringUtils.camelize(name, true);
case PascalCase:
return org.openapitools.codegen.utils.StringUtils.camelize(name);
case snake_case:
return org.openapitools.codegen.utils.StringUtils.underscore(name);
default:
throw new IllegalArgumentException("Invalid model property naming '" +
name + "'. Must be 'original', 'camelCase', " +
"'PascalCase' or 'snake_case'");
}
}
@@ -871,7 +880,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
codegenModel.getVendorExtensions().put("x-itemType", getSchemaType(ModelUtils.getAdditionalProperties(model)));
} else {
String type = model.getType();
if (isPrimitiveType(type)){
if (isPrimitiveType(type)) {
codegenModel.vendorExtensions.put("x-isPrimitive", true);
}
}

View File

@@ -239,6 +239,11 @@ public class ScalaGatlingCodegen extends AbstractScalaCodegen implements Codegen
continue;
}
for (Operation operation : path.readOperations()) {
if (operation.getExtensions() == null) {
operation.setExtensions(new HashMap());
}
if (!operation.getExtensions().keySet().contains("x-gatling-path")) {
if (pathname.contains("{")) {
String gatlingPath = pathname.replaceAll("\\{", "\\$\\{");

View File

@@ -302,9 +302,13 @@ public class ModelUtils {
if (schema instanceof ObjectSchema) {
return true;
}
// must not be a map
if (SchemaTypeUtil.OBJECT_TYPE.equals(schema.getType()) && !(schema instanceof MapSchema)) {
return true;
}
// must have at least one property
if (schema.getType() == null && schema.getProperties() != null && !schema.getProperties().isEmpty()) {
return true;
}
@@ -501,7 +505,70 @@ public class ModelUtils {
}
/**
* If a Schema contains a reference to an other Schema with '$ref', returns the referenced Schema if it is found or the actual Schema in the other cases.
* Check to see if the schema is a model with at least one properties
*
* @param schema potentially containing a '$ref'
* @return true if it's a model with at least one properties
*/
public static boolean isModel(Schema schema) {
if (schema == null) {
LOGGER.error("Schema cannot be null in isModel check");
return false;
}
// has at least one property
if (schema.getProperties() != null && !schema.getProperties().isEmpty()) {
return true;
}
// composed schema is a model
if (schema instanceof ComposedSchema) {
return true;
}
return false;
}
/**
* Check to see if the schema is a free form object
*
* @param schema potentially containing a '$ref'
* @return true if it's a free-form object
*/
public static boolean isFreeFormObject(Schema schema) {
if (schema == null) {
LOGGER.error("Schema cannot be null in isFreeFormObject check");
return false;
}
// has at least one property
if ("object".equals(schema.getType())) {
// no properties
if ((schema.getProperties() == null || schema.getProperties().isEmpty())) {
if (schema.getAdditionalProperties() == null) {
return true;
} else {
// additionalProperties set to true
if (schema.getAdditionalProperties() instanceof Boolean
&& (Boolean) schema.getAdditionalProperties()) {
return true;
}
// additionalProperties is set to {}
if (schema.getAdditionalProperties() instanceof Schema && schema.getAdditionalProperties() != null
&& schema.getAdditionalProperties() instanceof ObjectSchema
&& ((Schema) schema.getAdditionalProperties()).getProperties().isEmpty()) {
return true;
}
}
}
}
return false;
}
/**
* If a Schema contains a reference to another Schema with '$ref', returns the referenced Schema if it is found or the actual Schema in the other cases.
*
* @param openAPI specification being checked
* @param schema potentially containing a '$ref'
@@ -623,7 +690,7 @@ public class ModelUtils {
/**
* If a Callback contains a reference to an other Callback with '$ref', returns the referenced Callback if it is found or the actual Callback in the other cases.
*
* @param openAPI specification being checked
* @param openAPI specification being checked
* @param callback potentially containing a '$ref'
* @return callback without '$ref'
*/
@@ -689,7 +756,8 @@ public class ModelUtils {
*/
public static Schema unaliasSchema(Map<String, Schema> allSchemas, Schema schema) {
if (allSchemas == null || allSchemas.isEmpty()) {
LOGGER.warn("allSchemas cann't be null/empty in unaliasSchema. Returned 'schema'");
// skip the warning as the spec can have no model defined
//LOGGER.warn("allSchemas cannot be null/empty in unaliasSchema. Returned 'schema'");
return schema;
}
@@ -701,6 +769,8 @@ public class ModelUtils {
} else if (ref.getEnum() != null && !ref.getEnum().isEmpty()) {
// top-level enum class
return schema;
} else if (isFreeFormObject(ref)) {
return schema;
} else if (isArraySchema(ref) || isComposedSchema(ref)) { // array def should be created as models
return schema;
} else if (isMapSchema(ref)) {

View File

@@ -179,7 +179,7 @@ public class URLPathUtils {
LOGGER.warn("'scheme' not defined in the spec (2.0). Default to [http] for server URL [{}]", url);
} else if (url.startsWith("/")) {
url = LOCAL_HOST + url;
LOGGER.warn("'host' not defined in the spec (2.0). Default to [{}] for server URL [{}]", LOCAL_HOST, url);
LOGGER.warn("'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [{}] for server URL [{}]", LOCAL_HOST, url);
} else if (!url.matches("[a-zA-Z][0-9a-zA-Z.+\\-]+://.+")) {
// Add http scheme for urls without a scheme.
// 2.0 spec is restricted to the following schemes: "http", "https", "ws", "wss"

View File

@@ -145,7 +145,7 @@ public class ApiClient {
/**
* Get base path
*
* @return Baes path
* @return Base path
*/
public String getBasePath() {
return basePath;

View File

@@ -445,7 +445,7 @@
}
}
}
} else if (bodyParam) {
} else if (bodyParam !== null && bodyParam !== undefined) {
request.send(bodyParam);
}
@@ -546,8 +546,8 @@
if (type === Object) {
// generic object, return directly
return data;
} else if (typeof type === 'function') {
// for model type like: User
} else if (typeof type.constructFromObject === 'function') {
// for model type like User or enum class
return type.constructFromObject(data);
} else if (Array.isArray(type)) {
// for array type like: ['String']

View File

@@ -397,7 +397,7 @@ class ApiClient {
}
}
}
} else if (bodyParam) {
} else if (bodyParam !== null && bodyParam !== undefined) {
request.send(bodyParam);
}
@@ -502,8 +502,8 @@ class ApiClient {
if (type === Object) {
// generic object, return directly
return data;
} else if (typeof type === 'function') {
// for model type like: User
} else if (typeof type.constructFromObject === 'function') {
// for model type like User and enum class
return type.constructFromObject(data);
} else if (Array.isArray(type)) {
// for array type like: ['String']

View File

@@ -260,6 +260,11 @@ pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/r
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("{{httpMethod}}"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK

View File

@@ -16,6 +16,7 @@
#include <memory>
#include <vector>
#include <functional>
#include <cpprest/details/basic_types.h>
#include <cpprest/http_client.h>
@@ -32,6 +33,11 @@ public:
ApiClient( std::shared_ptr<ApiConfiguration> configuration = nullptr );
virtual ~ApiClient();
typedef std::function<void(const web::http::http_headers&)> ResponseHeadersHandlerType;
const ResponseHeadersHandlerType& getResponseHeadersHandler() const;
void setResponseHeadersHandler(const ResponseHeadersHandlerType& responseHeadersHandler);
std::shared_ptr<ApiConfiguration> getConfiguration() const;
void setConfiguration(std::shared_ptr<ApiConfiguration> configuration);
@@ -57,6 +63,7 @@ public:
protected:
ResponseHeadersHandlerType m_ResponseHeadersHandler;
std::shared_ptr<ApiConfiguration> m_Configuration;
};

View File

@@ -29,6 +29,14 @@ ApiClient::~ApiClient()
{
}
const ApiClient::ResponseHeadersHandlerType& ApiClient::getResponseHeadersHandler() const {
return m_ResponseHeadersHandler;
}
void ApiClient::setResponseHeadersHandler(const ResponseHeadersHandlerType& responseHeadersHandler) {
m_ResponseHeadersHandler = responseHeadersHandler;
}
std::shared_ptr<ApiConfiguration> ApiClient::getConfiguration() const
{
return m_Configuration;

View File

@@ -34,7 +34,7 @@ defmodule {{moduleName}}.Api.{{classname}} do
{:error, info} on failure
"""
{{{typespec}}}
def {{#underscored}}{{{operationId}}}{{/underscored}}(connection, {{#requiredParams}}{{#underscored}}{{{paramName}}}{{/underscored}}, {{/requiredParams}}{{^hasOptionalParams}}_{{/hasOptionalParams}}opts \\ []) do
def {{{operationId}}}(connection, {{#requiredParams}}{{#underscored}}{{{paramName}}}{{/underscored}}, {{/requiredParams}}{{^hasOptionalParams}}_{{/hasOptionalParams}}opts \\ []) do
{{#optionalParams}}
{{#-first}}
optional_params = %{

View File

@@ -1,4 +1,4 @@
type {{#vendorExtensions}}{{elmUnionType}}{{/vendorExtensions}}
type {{#vendorExtensions}}{{elmCustomType}}{{/vendorExtensions}}
{{#allowableValues}}
{{#enumVars}}
{{#-first}}={{/-first}}{{^-first}}|{{/-first}} {{name}}

View File

@@ -1,4 +1,4 @@
{{vendorExtensions.elmDecoder}} : Decoder {{vendorExtensions.elmUnionType}}
{{vendorExtensions.elmDecoder}} : Decoder {{vendorExtensions.elmCustomType}}
{{vendorExtensions.elmDecoder}} =
Decode.string
|> Decode.andThen

View File

@@ -1,4 +1,4 @@
{{vendorExtensions.elmEncoder}} : {{vendorExtensions.elmUnionType}} -> Encode.Value
{{vendorExtensions.elmEncoder}} : {{vendorExtensions.elmCustomType}} -> Encode.Value
{{vendorExtensions.elmEncoder}} model =
case model of
{{#allowableValues}}

View File

@@ -1 +0,0 @@
{{#required}}required{{/required}}{{^required}}optional{{/required}} "{{baseName}}" {{^required}}(Decode.nullable {{/required}}{{#isMapContainer}}(Decode.dict {{/isMapContainer}}{{#isListContainer}}(Decode.list {{/isListContainer}}{{vendorExtensions.elmDecoder}}{{#isContainer}}){{/isContainer}}{{^required}}){{/required}}{{^required}} {{{defaultValue}}}{{/required}}

View File

@@ -1 +0,0 @@
( "{{baseName}}", {{#discriminatorValue}}Encode.string "{{discriminatorValue}}"{{/discriminatorValue}}{{^discriminatorValue}}{{^required}}Maybe.withDefault Encode.null (Maybe.map {{/required}}{{#isMapContainer}}(Encode.dict identity {{/isMapContainer}}{{#isListContainer}}(Encode.list {{#isElm018}}<< List.map {{/isElm018}}{{/isListContainer}}{{vendorExtensions.elmEncoder}}{{#isContainer}}){{/isContainer}} model.{{name}}{{^required}}){{/required}}{{/discriminatorValue}} )

View File

@@ -1,6 +1,6 @@
{{>licenseInfo}}
module Data.{{classname}} exposing ({{#models}}{{#model}}{{classname}}{{#hasChildren}}(..){{/hasChildren}}{{#isEnum}}(..){{/isEnum}}{{^isEnum}}{{#vars}}{{#isEnum}}, {{vendorExtensions.elmUnionType}}(..){{/isEnum}}{{/vars}}{{/isEnum}}, decoder, encoder{{/model}}{{/models}})
module Data.{{classname}} exposing ({{#models}}{{#model}}{{classname}}{{#hasChildren}}(..){{/hasChildren}}{{#isEnum}}(..){{/isEnum}}{{^isEnum}}{{#vars}}{{#isEnum}}, {{vendorExtensions.elmCustomType}}(..){{/isEnum}}{{/vars}}{{/isEnum}}, decoder, encoder{{/model}}{{/models}})
{{>imports}}import Dict exposing (Dict)
import Json.Decode as Decode exposing (Decoder)
@@ -14,6 +14,6 @@ import Json.Encode as Encode
{-| {{{description}}}
-}
{{/description}}
{{#isEnum}}{{>modelTypeUnion}}{{/isEnum}}{{^isEnum}}{{#discriminator}}{{>modelTypeDiscriminator}}{{/discriminator}}{{^discriminator}}{{#isAlias}}{{>modelTypePrimitive}}{{/isAlias}}{{^isAlias}}{{#isArrayModel}}{{>modelTypeArray}}{{/isArrayModel}}{{^isArrayModel}}{{>modelTypeAlias}}{{/isArrayModel}}{{/isAlias}}{{/discriminator}}{{/isEnum}}
{{#isEnum}}{{>modelTypeCustom}}{{/isEnum}}{{^isEnum}}{{#discriminator}}{{>modelTypeDiscriminator}}{{/discriminator}}{{^discriminator}}{{#isAlias}}{{>modelTypePrimitive}}{{/isAlias}}{{^isAlias}}{{#isArrayModel}}{{>modelTypeArray}}{{/isArrayModel}}{{^isArrayModel}}{{>modelTypeRecord}}{{/isArrayModel}}{{/isAlias}}{{/discriminator}}{{/isEnum}}
{{/model}}
{{/models}}

View File

@@ -1,26 +0,0 @@
type alias {{classname}} =
{ {{#allVars}}{{^-first}} , {{/-first}}{{name}} : {{^required}}Maybe {{#isContainer}}({{/isContainer}}{{/required}}{{#isMapContainer}}Dict String {{/isMapContainer}}{{#isListContainer}}List {{/isListContainer}}{{#isEnum}}{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{^required}}{{#isContainer}}){{/isContainer}}{{/required}}
{{/allVars}} }
{{#vars}}
{{#isEnum}}
{{>union}}
{{/isEnum}}
{{/vars}}
{{>aliasDecoder}}
{{>aliasEncoder}}
{{#vars}}
{{#isEnum}}
{{>unionDecoder}}
{{>unionEncoder}}
{{/isEnum}}
{{/vars}}

View File

@@ -0,0 +1,7 @@
{{>customType}}
{{>customTypeDecoder}}
{{>customTypeEncoder}}

View File

@@ -0,0 +1,26 @@
type alias {{classname}} =
{ {{#allVars}}{{^-first}} , {{/-first}}{{name}} : {{^required}}{{^isNullable}}Maybe ({{/isNullable}}{{/required}}{{>recordFieldType}}{{^required}}{{^isNullable}}){{/isNullable}}{{/required}}
{{/allVars}} }
{{#vars}}
{{#isEnum}}
{{>customType}}
{{/isEnum}}
{{/vars}}
{{>recordDecoder}}
{{>recordEncoder}}
{{#vars}}
{{#isEnum}}
{{>customTypeDecoder}}
{{>customTypeEncoder}}
{{/isEnum}}
{{/vars}}

View File

@@ -1,7 +0,0 @@
{{>union}}
{{>unionDecoder}}
{{>unionEncoder}}

View File

@@ -2,5 +2,5 @@ decoder : Decoder {{classname}}
decoder =
{{#isElm018}}decode{{/isElm018}}{{#isElm019}}Decode.succeed{{/isElm019}} {{classname}}
{{#allVars}}
|> {{>fieldDecoder}}
|> {{>recordFieldDecoder}}
{{/allVars}}

View File

@@ -2,6 +2,6 @@ encoder : {{#vendorExtensions.discriminatorName}}String -> {{/vendorExtensions.d
encoder {{#vendorExtensions.discriminatorName}}tag {{/vendorExtensions.discriminatorName}}model =
Encode.object
{{#allVars}}
{{#-first}}[{{/-first}}{{^-first}},{{/-first}} {{>fieldEncoder}}
{{#-first}}[{{/-first}}{{^-first}},{{/-first}} {{>recordFieldEncoder}}
{{/allVars}}{{#vendorExtensions.discriminatorName}} , ( "{{{vendorExtensions.discriminatorName}}}", Encode.string tag ){{/vendorExtensions.discriminatorName}}
]

View File

@@ -0,0 +1 @@
{{#required}}required{{/required}}{{^required}}optional{{/required}} "{{baseName}}" {{^required}}{{^isNullable}}(Decode.nullable {{/isNullable}}{{/required}}{{>recordFieldValueDecoder}}{{^required}}{{^isNullable}}) {{{defaultValue}}}{{/isNullable}}{{/required}}

View File

@@ -0,0 +1 @@
( "{{baseName}}", {{#discriminatorValue}}Encode.string "{{discriminatorValue}}"{{/discriminatorValue}}{{^discriminatorValue}}{{^required}}{{^isNullable}}Maybe.withDefault Encode.null (Maybe.map {{/isNullable}}{{/required}}{{>recordFieldValueEncoder}} model.{{name}}{{^required}}{{^isNullable}}){{/isNullable}}{{/required}}{{/discriminatorValue}} )

View File

@@ -0,0 +1 @@
{{#isNullable}}(Maybe {{/isNullable}}{{#isContainer}}({{#isListContainer}}List{{/isListContainer}}{{#isMapContainer}}Dict String{{/isMapContainer}} {{#items}}{{>recordFieldType}}{{/items}}){{/isContainer}}{{^isContainer}}{{#isEnum}}{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{/isContainer}}{{#isNullable}}){{/isNullable}}

View File

@@ -0,0 +1 @@
{{#isNullable}}(Decode.nullable {{/isNullable}}{{#isContainer}}({{#isListContainer}}Decode.list{{/isListContainer}}{{#isMapContainer}}Decode.dict{{/isMapContainer}} {{#items}}{{>recordFieldValueDecoder}}{{/items}}){{/isContainer}}{{^isContainer}}{{vendorExtensions.elmDecoder}}{{/isContainer}}{{#isNullable}}) {{{defaultValue}}}{{/isNullable}}

View File

@@ -0,0 +1 @@
{{#isNullable}}Maybe.withDefault Encode.null (Maybe.map {{/isNullable}}{{#isContainer}}({{#isListContainer}}Encode.list{{#isElm018}} << List.map{{/isElm018}}{{/isListContainer}}{{#isMapContainer}}Encode.dict identity{{/isMapContainer}} {{#items}}{{>recordFieldValueEncoder}}{{/items}}{{/isContainer}}{{^isContainer}}{{vendorExtensions.elmEncoder}}{{/isContainer}}{{#isContainer}}){{/isContainer}}{{#isNullable}}){{/isNullable}}

View File

@@ -1,8 +1,8 @@
resolver: lts-10.10
resolver: lts-12.18
build:
haddock-arguments:
haddock-args:
- "--odir=./docs"
extra-deps: []
extra-deps: [ {{^x-useMonadLogger}}katip-0.5.5.1{{/x-useMonadLogger}} ]
packages:
- '.'

View File

@@ -3,7 +3,7 @@
{{#artifactVersion}}
"version": "{{artifactVersion}}",
{{/artifactVersion}}
"description": "{{description}}",
"description": "{{{appDescription}}}",
"keywords": [
"openapitools",
"openapi-generator",

View File

@@ -29,8 +29,7 @@
"@angular/compiler": "^{{ngVersion}}",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "{{#useRxJS6}}^6.1.0{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}",
"zone.js": "^0.7.6"
"rxjs": "{{#useRxJS6}}^6.1.0{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}"
},
"devDependencies": {
"@angular/compiler-cli": "^{{ngVersion}}",
@@ -42,7 +41,7 @@
"ng-packagr": {{#useOldNgPackagr}}"^1.6.0"{{/useOldNgPackagr}}{{^useOldNgPackagr}}"^2.4.1"{{/useOldNgPackagr}},{{/useNgPackagr}}
"reflect-metadata": "^0.1.3",
"rxjs": "{{#useRxJS6}}^6.1.0{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}",
"zone.js": "^0.7.6",
"zone.js": "^0.7.6 || ^0.8.26",
"typescript": ">=2.1.5 <2.8"
}{{#npmRepository}},{{/npmRepository}}
{{#npmRepository}}

View File

@@ -238,7 +238,7 @@ public class KotlinClientCodegenModelTest {
Assert.assertEquals(property1.name, "child");
Assert.assertEquals(property1.baseType, "Child");
Assert.assertFalse(property1.required);
Assert.assertTrue(property1.isNotContainer);
Assert.assertFalse(property1.isContainer);
}
@DataProvider(name = "modelNames")

View File

@@ -1054,7 +1054,7 @@
<module>samples/client/petstore/typescript-angular-v4.3/npm</module>
<module>samples/client/petstore/typescript-angular-v6-provided-in-root</module>
<!--<module>samples/client/petstore/bash</module>-->
<module>samples/client/petstore/ruby</module>
<module>samples/openapi3/client/petstore/ruby</module>
<module>samples/server/petstore/rust-server</module>
</modules>
</profile>

View File

@@ -1,6 +1,6 @@
{
"name": "GIT_USER_ID/GIT_REPO_ID",
"description": "",
"description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --",
"keywords": [
"openapitools",
"openapi-generator",

View File

@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT
* OpenAPI Generator version: 3.3.4-SNAPSHOT
*/
/**
@@ -253,10 +253,10 @@ class FakeApi
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {

View File

@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT
* OpenAPI Generator version: 3.3.4-SNAPSHOT
*/
/**

View File

@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT
* OpenAPI Generator version: 3.3.4-SNAPSHOT
*/
/**

View File

@@ -17,7 +17,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT
* OpenAPI Generator version: 3.3.4-SNAPSHOT
*/
/**

View File

@@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT
* OpenAPI Generator version: 3.3.4-SNAPSHOT
*/
/**

View File

@@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT
* OpenAPI Generator version: 3.3.4-SNAPSHOT
*/
/**

View File

@@ -18,7 +18,7 @@
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.0-SNAPSHOT
* OpenAPI Generator version: 3.3.4-SNAPSHOT
*/
/**
@@ -29,6 +29,8 @@
namespace OpenAPI\Client;
use OpenAPI\Client\Model\ModelInterface;
/**
* ObjectSerializer Class Doc Comment
*
@@ -61,19 +63,25 @@ class ObjectSerializer
return $data;
} elseif (is_object($data)) {
$values = [];
$formats = $data::openAPIFormats();
foreach ($data::openAPITypes() as $property => $openAPIType) {
$getter = $data::getters()[$property];
$value = $data->$getter();
if ($value !== null
&& !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
&& method_exists($openAPIType, 'getAllowableEnumValues')
&& !in_array($value, $openAPIType::getAllowableEnumValues(), true)) {
$imploded = implode("', '", $openAPIType::getAllowableEnumValues());
throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'");
if ($data instanceof ModelInterface) {
$formats = $data::openAPIFormats();
foreach ($data::openAPITypes() as $property => $openAPIType) {
$getter = $data::getters()[$property];
$value = $data->$getter();
if ($value !== null
&& !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)
&& method_exists($openAPIType, 'getAllowableEnumValues')
&& !in_array($value, $openAPIType::getAllowableEnumValues(), true)) {
$imploded = implode("', '", $openAPIType::getAllowableEnumValues());
throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'");
}
if ($value !== null) {
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
}
}
if ($value !== null) {
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]);
} else {
foreach($data as $property => $value) {
$values[$property] = self::sanitizeForSerialization($value);
}
}
return (object)$values;

View File

@@ -1 +1 @@
3.3.3-SNAPSHOT
3.3.0-SNAPSHOT

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -40,6 +40,14 @@ ApiClient::~ApiClient()
{
}
const ApiClient::ResponseHeadersHandlerType& ApiClient::getResponseHeadersHandler() const {
return m_ResponseHeadersHandler;
}
void ApiClient::setResponseHeadersHandler(const ResponseHeadersHandlerType& responseHeadersHandler) {
m_ResponseHeadersHandler = responseHeadersHandler;
}
std::shared_ptr<ApiConfiguration> ApiClient::getConfiguration() const
{
return m_Configuration;

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -26,6 +26,7 @@
#include <memory>
#include <vector>
#include <functional>
#include <cpprest/details/basic_types.h>
#include <cpprest/http_client.h>
@@ -43,6 +44,11 @@ public:
ApiClient( std::shared_ptr<ApiConfiguration> configuration = nullptr );
virtual ~ApiClient();
typedef std::function<void(const web::http::http_headers&)> ResponseHeadersHandlerType;
const ResponseHeadersHandlerType& getResponseHeadersHandler() const;
void setResponseHeadersHandler(const ResponseHeadersHandlerType& responseHeadersHandler);
std::shared_ptr<ApiConfiguration> getConfiguration() const;
void setConfiguration(std::shared_ptr<ApiConfiguration> configuration);
@@ -68,6 +74,7 @@ public:
protected:
ResponseHeadersHandlerType m_ResponseHeadersHandler;
std::shared_ptr<ApiConfiguration> m_Configuration;
};

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -123,6 +123,11 @@ pplx::task<void> PetApi::addPet(std::shared_ptr<Pet> pet)
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -224,6 +229,11 @@ pplx::task<void> PetApi::deletePet(int64_t petId, boost::optional<utility::strin
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -325,6 +335,11 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByStatus(std::vect
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -451,6 +466,11 @@ pplx::task<std::vector<std::shared_ptr<Pet>>> PetApi::findPetsByTags(std::vector
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -581,6 +601,11 @@ pplx::task<std::shared_ptr<Pet>> PetApi::getPetById(int64_t petId)
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -718,6 +743,11 @@ pplx::task<void> PetApi::updatePet(std::shared_ptr<Pet> pet)
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -824,6 +854,11 @@ pplx::task<void> PetApi::updatePetWithForm(int64_t petId, boost::optional<utilit
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -931,6 +966,11 @@ pplx::task<std::shared_ptr<ApiResponse>> PetApi::uploadFile(int64_t petId, boost
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -25,7 +25,7 @@
#include "HttpContent.h"
#include "Pet.h"
#include <cpprest/details/basic_types.h>
#include "../ModelBase.h"
#include <boost/optional.hpp>
@@ -63,7 +63,7 @@ public:
///
/// </remarks>
/// <param name="petId">Pet id to delete</param>
/// <param name="apiKey"> (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="apiKey"> (optional)</param>
pplx::task<void> deletePet(
int64_t petId,
boost::optional<utility::string_t> apiKey

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -99,6 +99,11 @@ pplx::task<void> StoreApi::deleteOrder(utility::string_t orderId)
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -202,6 +207,11 @@ pplx::task<std::map<utility::string_t, int32_t>> StoreApi::getInventory()
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -322,6 +332,11 @@ pplx::task<std::shared_ptr<Order>> StoreApi::getOrderById(int64_t orderId)
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -457,6 +472,11 @@ pplx::task<std::shared_ptr<Order>> StoreApi::placeOrder(std::shared_ptr<Order> o
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -24,7 +24,7 @@
#include "Order.h"
#include <map>
#include <cpprest/details/basic_types.h>
#include "../ModelBase.h"
#include <boost/optional.hpp>

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -119,6 +119,11 @@ pplx::task<void> UserApi::createUser(std::shared_ptr<User> user)
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -239,6 +244,11 @@ pplx::task<void> UserApi::createUsersWithArrayInput(std::vector<std::shared_ptr<
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -359,6 +369,11 @@ pplx::task<void> UserApi::createUsersWithListInput(std::vector<std::shared_ptr<U
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -454,6 +469,11 @@ pplx::task<void> UserApi::deleteUser(utility::string_t username)
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -551,6 +571,11 @@ pplx::task<std::shared_ptr<User>> UserApi::getUserByName(utility::string_t usern
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -676,6 +701,11 @@ pplx::task<utility::string_t> UserApi::loginUser(utility::string_t username, uti
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -793,6 +823,11 @@ pplx::task<void> UserApi::logoutUser()
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
@@ -909,6 +944,11 @@ pplx::task<void> UserApi::updateUser(utility::string_t username, std::shared_ptr
return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse)
{
if (m_ApiClient->getResponseHeadersHandler())
{
m_ApiClient->getResponseHeadersHandler()(localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
@@ -24,7 +24,7 @@
#include "User.h"
#include <vector>
#include <cpprest/details/basic_types.h>
#include "../ModelBase.h"
#include <boost/optional.hpp>

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -4,7 +4,7 @@
*
* OpenAPI spec version: 1.0.0
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.3-SNAPSHOT.
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.0-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -1 +1 @@
3.0.0-SNAPSHOT
3.3.4-SNAPSHOT

View File

@@ -10,11 +10,11 @@ use Mix.Config
# You can configure for your application as:
#
# config :swagger_petstore, key: :value
# config :open_api_petstore, key: :value
#
# And access this configuration in your application as:
#
# Application.get_env(:swagger_petstore, :key)
# Application.get_env(:open_api_petstore, :key)
#
# Or configure a 3rd-party app:
#

View File

@@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Api.AnotherFake do
@doc """
To test special tags
To test special tags
To test special tags and operation ID starting with number
## Parameters
@@ -25,8 +25,8 @@ defmodule OpenapiPetstore.Api.AnotherFake do
{:ok, %OpenapiPetstore.Model.Client{}} on success
{:error, info} on failure
"""
@spec test_special_tags(Tesla.Env.client, OpenapiPetstore.Model.Client.t, keyword()) :: {:ok, OpenapiPetstore.Model.Client.t} | {:error, Tesla.Env.t}
def test_special_tags(connection, client, _opts \\ []) do
@spec call_123_test_special_tags(Tesla.Env.client, OpenapiPetstore.Model.Client.t, keyword()) :: {:ok, OpenapiPetstore.Model.Client.t} | {:error, Tesla.Env.t}
def call_123_test_special_tags(connection, client, _opts \\ []) do
%{}
|> method(:patch)
|> url("/another-fake/dummy")

View File

@@ -21,7 +21,7 @@ defmodule OpenapiPetstore.Api.Fake do
- :body (boolean()): Input boolean as post body
## Returns
{:ok, %OpenapiPetstore.Model.Boolean{}} on success
{:ok, %OpenapiPetstore.Model.boolean(){}} on success
{:error, info} on failure
"""
@spec fake_outer_boolean_serialize(Tesla.Env.client, keyword()) :: {:ok, Boolean.t} | {:error, Tesla.Env.t}
@@ -75,7 +75,7 @@ defmodule OpenapiPetstore.Api.Fake do
- :body (float()): Input number as post body
## Returns
{:ok, %OpenapiPetstore.Model.Float{}} on success
{:ok, %OpenapiPetstore.Model.float(){}} on success
{:error, info} on failure
"""
@spec fake_outer_number_serialize(Tesla.Env.client, keyword()) :: {:ok, Float.t} | {:error, Tesla.Env.t}
@@ -102,7 +102,7 @@ defmodule OpenapiPetstore.Api.Fake do
- :body (String.t): Input string as post body
## Returns
{:ok, %OpenapiPetstore.Model.String{}} on success
{:ok, %OpenapiPetstore.Model.String.t{}} on success
{:error, info} on failure
"""
@spec fake_outer_string_serialize(Tesla.Env.client, keyword()) :: {:ok, String.t} | {:error, Tesla.Env.t}
@@ -119,6 +119,30 @@ defmodule OpenapiPetstore.Api.Fake do
|> decode(false)
end
@doc """
For this test, the body for this request much reference a schema named &#x60;File&#x60;.
## Parameters
- connection (OpenapiPetstore.Connection): Connection to server
- file_schema_test_class (FileSchemaTestClass):
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %{}} on success
{:error, info} on failure
"""
@spec test_body_with_file_schema(Tesla.Env.client, OpenapiPetstore.Model.FileSchemaTestClass.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def test_body_with_file_schema(connection, file_schema_test_class, _opts \\ []) do
%{}
|> method(:put)
|> url("/fake/body-with-file-schema")
|> add_param(:body, :"FileSchemaTestClass", file_schema_test_class)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(false)
end
@doc """
## Parameters
@@ -265,13 +289,51 @@ defmodule OpenapiPetstore.Api.Fake do
|> decode(false)
end
@doc """
Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
## Parameters
- connection (OpenapiPetstore.Connection): Connection to server
- required_string_group (integer()): Required String in group parameters
- required_boolean_group (boolean()): Required Boolean in group parameters
- required_int64_group (integer()): Required Integer in group parameters
- opts (KeywordList): [optional] Optional parameters
- :string_group (integer()): String in group parameters
- :boolean_group (boolean()): Boolean in group parameters
- :int64_group (integer()): Integer in group parameters
## Returns
{:ok, %{}} on success
{:error, info} on failure
"""
@spec test_group_parameters(Tesla.Env.client, integer(), boolean(), integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}
def test_group_parameters(connection, required_string_group, required_boolean_group, required_int64_group, opts \\ []) do
optional_params = %{
:"string_group" => :query,
:"boolean_group" => :headers,
:"int64_group" => :query
}
%{}
|> method(:delete)
|> url("/fake")
|> add_param(:query, :"required_string_group", required_string_group)
|> add_param(:headers, :"required_boolean_group", required_boolean_group)
|> add_param(:query, :"required_int64_group", required_int64_group)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(false)
end
@doc """
test inline additionalProperties
## Parameters
- connection (OpenapiPetstore.Connection): Connection to server
- request_body (String.t): request body
- request_body (%{optional(String.t) &#x3D;&gt; String.t}): request body
- opts (KeywordList): [optional] Optional parameters
## Returns

View File

@@ -220,4 +220,34 @@ defmodule OpenapiPetstore.Api.Pet do
|> (&Connection.request(connection, &1)).()
|> decode(%OpenapiPetstore.Model.ApiResponse{})
end
@doc """
uploads an image (required)
## Parameters
- connection (OpenapiPetstore.Connection): Connection to server
- pet_id (integer()): ID of pet to update
- required_file (String.t): file to upload
- opts (KeywordList): [optional] Optional parameters
- :additional_metadata (String.t): Additional data to pass to server
## Returns
{:ok, %OpenapiPetstore.Model.ApiResponse{}} on success
{:error, info} on failure
"""
@spec upload_file_with_required_file(Tesla.Env.client, integer(), String.t, keyword()) :: {:ok, OpenapiPetstore.Model.ApiResponse.t} | {:error, Tesla.Env.t}
def upload_file_with_required_file(connection, pet_id, required_file, opts \\ []) do
optional_params = %{
:"additionalMetadata" => :form
}
%{}
|> method(:post)
|> url("/fake/#{pet_id}/uploadImageWithRequiredFile")
|> add_param(:file, :"requiredFile", required_file)
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%OpenapiPetstore.Model.ApiResponse{})
end
end

View File

@@ -15,7 +15,7 @@ defmodule OpenapiPetstore.Connection do
plug Tesla.Middleware.EncodeJson
@doc """
Configure an client connection using Basic authentication.
Configure a client connection using Basic authentication.
## Parameters

View File

@@ -0,0 +1,30 @@
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule OpenapiPetstore.Model.FileSchemaTestClass do
@moduledoc """
"""
@derive [Poison.Encoder]
defstruct [
:"file",
:"files"
]
@type t :: %__MODULE__{
:"file" => File,
:"files" => [File]
}
end
defimpl Poison.Decoder, for: OpenapiPetstore.Model.FileSchemaTestClass do
import OpenapiPetstore.Deserializer
def decode(value, options) do
value
|> deserialize(:"file", :struct, OpenapiPetstore.Model.File, options)
|> deserialize(:"files", :list, OpenapiPetstore.Model.File, options)
end
end

View File

@@ -10,12 +10,16 @@ defmodule OpenapiPetstore.Model.MapTest do
@derive [Poison.Encoder]
defstruct [
:"map_map_of_string",
:"map_of_enum_string"
:"map_of_enum_string",
:"direct_map",
:"indirect_map"
]
@type t :: %__MODULE__{
:"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}},
:"map_of_enum_string" => %{optional(String.t) => String.t}
:"map_of_enum_string" => %{optional(String.t) => String.t},
:"direct_map" => %{optional(String.t) => boolean()},
:"indirect_map" => %{optional(String.t) => boolean()}
}
end

View File

@@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.OuterComposite do
]
@type t :: %__MODULE__{
:"my_number" => Float,
:"my_string" => String,
:"my_boolean" => Boolean
:"my_number" => float(),
:"my_string" => String.t,
:"my_boolean" => boolean()
}
end

View File

@@ -0,0 +1,25 @@
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule OpenapiPetstore.Model.StringBooleanMap do
@moduledoc """
"""
@derive [Poison.Encoder]
defstruct [
]
@type t :: %__MODULE__{
}
end
defimpl Poison.Decoder, for: OpenapiPetstore.Model.StringBooleanMap do
def decode(value, _options) do
value
end
end

View File

@@ -1 +1,5 @@
<<<<<<< HEAD
4.0.0-SNAPSHOT
=======
3.3.4-SNAPSHOT
>>>>>>> origin

Some files were not shown because too many files have changed in this diff Show More