This commit is contained in:
wing328 2017-04-03 15:05:58 +08:00
commit 028cbc77b6
199 changed files with 5120 additions and 1992 deletions

View File

@ -1,10 +1,12 @@
#!/bin/bash #!/bin/bash
# grep for \t in the generators # grep for \t in the generators
grep -RUIl $'\t$' modules/swagger-codegen/src/main/java/io/swagger/codegen/*.java RESULT=`find modules/swagger-codegen/src/ -name "*.java" | xargs grep $'\t'`
if [ $? -ne 1 ]; then echo -e "$RESULT"
echo "Generators (Java class files) contain tab '/t'. Please remove it and try again."
if [ "$RESULT" != "" ]; then
echo "Java files contain tab '\\t'. Please remove it and try again."
exit 1; exit 1;
fi fi

View File

@ -25,7 +25,8 @@ public class AuthParser {
for (String part : parts) { for (String part : parts) {
String[] kvPair = part.split(":"); String[] kvPair = part.split(":");
if (kvPair.length == 2) { if (kvPair.length == 2) {
auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header")); // FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ? // FIXME replace the deprecated method by decode(string, encoding). Which encoding is used ? Default UTF-8 ?
auths.add(new AuthorizationValue(URLDecoder.decode(kvPair[0]), URLDecoder.decode(kvPair[1]), "header"));
} }
} }
} }
@ -53,5 +54,4 @@ public class AuthParser {
return null; return null;
} }
} }
} }

View File

@ -1,15 +1,25 @@
package io.swagger.codegen.languages; package io.swagger.codegen.languages;
import io.swagger.codegen.*; import java.util.ArrayList;
import io.swagger.codegen.languages.features.BeanValidationFeatures; import java.util.Arrays;
import io.swagger.models.Operation; import java.util.HashMap;
import io.swagger.models.Path; import java.util.List;
import io.swagger.models.Swagger; import java.util.Map;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.*; import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.CodegenResponse;
import io.swagger.codegen.CodegenType;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
import io.swagger.models.Operation;
import io.swagger.models.Path;
import io.swagger.models.Swagger;
public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen implements BeanValidationFeatures {
/** /**
@ -25,8 +35,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class); static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class);
public AbstractJavaJAXRSServerCodegen() public AbstractJavaJAXRSServerCodegen() {
{
super(); super();
sourceFolder = "src/gen/java"; sourceFolder = "src/gen/java";
@ -46,7 +55,6 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
cliOptions.add(new CliOption("serverPort", "The port on which the server should be started")); cliOptions.add(new CliOption("serverPort", "The port on which the server should be started"));
} }
@ -55,8 +63,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
// =============== // ===============
@Override @Override
public CodegenType getTag() public CodegenType getTag() {
{
return CodegenType.SERVER; return CodegenType.SERVER;
} }
@ -235,4 +242,5 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
this.useBeanValidation = useBeanValidation; this.useBeanValidation = useBeanValidation;
} }
} }

View File

@ -11,18 +11,21 @@ import org.slf4j.LoggerFactory;
import io.swagger.codegen.CliOption; import io.swagger.codegen.CliOption;
import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenModel;
import io.swagger.codegen.CodegenOperation; import io.swagger.codegen.CodegenOperation;
import io.swagger.codegen.CodegenParameter;
import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.CodegenProperty;
import io.swagger.codegen.CodegenResponse;
import io.swagger.codegen.CodegenType; import io.swagger.codegen.CodegenType;
import io.swagger.codegen.SupportingFile; import io.swagger.codegen.SupportingFile;
import io.swagger.codegen.languages.features.BeanValidationFeatures; import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.codegen.languages.features.GzipTestFeatures; import io.swagger.codegen.languages.features.GzipTestFeatures;
import io.swagger.codegen.languages.features.JaxbFeatures; import io.swagger.codegen.languages.features.JaxbFeatures;
import io.swagger.codegen.languages.features.LoggingTestFeatures; import io.swagger.codegen.languages.features.LoggingTestFeatures;
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
import io.swagger.models.Operation; import io.swagger.models.Operation;
public class JavaCXFClientCodegen extends AbstractJavaCodegen public class JavaCXFClientCodegen extends AbstractJavaCodegen
implements BeanValidationFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures implements BeanValidationFeatures, UseGenericResponseFeatures, JaxbFeatures, GzipTestFeatures, LoggingTestFeatures {
{
private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class); private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFClientCodegen.class);
/** /**
@ -35,6 +38,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
protected boolean useBeanValidation = false; protected boolean useBeanValidation = false;
protected boolean useGenericResponse = false;
protected boolean useGzipFeatureForTests = false; protected boolean useGzipFeatureForTests = false;
protected boolean useLoggingFeatureForTests = false; protected boolean useLoggingFeatureForTests = false;
@ -75,7 +80,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests")); cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE_FOR_TESTS, "Use Gzip Feature for tests"));
cliOptions.add(CliOption.newBoolean(USE_LOGGING_FEATURE_FOR_TESTS, "Use Logging Feature for tests")); cliOptions.add(CliOption.newBoolean(USE_LOGGING_FEATURE_FOR_TESTS, "Use Logging Feature for tests"));
cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response"));
} }
@ -94,6 +99,14 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
this.setUseBeanValidation(useBeanValidationProp); this.setUseBeanValidation(useBeanValidationProp);
} }
if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) {
this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE));
}
if (useGenericResponse) {
writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse);
}
this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS)); this.setUseGzipFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_GZIP_FEATURE_FOR_TESTS));
this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS)); this.setUseLoggingFeatureForTests(convertPropertyToBooleanAndWriteBack(USE_LOGGING_FEATURE_FOR_TESTS));
@ -132,6 +145,28 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
model.imports.remove("ToStringSerializer"); model.imports.remove("ToStringSerializer");
} }
@Override
@SuppressWarnings("unchecked")
public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
objs = super.postProcessOperations(objs);
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
if (operations != null) {
List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation operation : ops) {
if (operation.returnType == null) {
operation.returnType = "void";
// set vendorExtensions.x-java-is-response-void to true as
// returnType is set to "void"
operation.vendorExtensions.put("x-java-is-response-void", true);
}
}
}
return operations;
}
@Override @Override
public String getHelp() public String getHelp()
{ {
@ -155,4 +190,8 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen
this.useLoggingFeatureForTests = useLoggingFeatureForTests; this.useLoggingFeatureForTests = useLoggingFeatureForTests;
} }
public void setUseGenericResponse(boolean useGenericResponse) {
this.useGenericResponse = useGenericResponse;
}
} }

View File

@ -17,10 +17,11 @@ import io.swagger.codegen.languages.features.CXFServerFeatures;
import io.swagger.codegen.languages.features.GzipTestFeatures; import io.swagger.codegen.languages.features.GzipTestFeatures;
import io.swagger.codegen.languages.features.JaxbFeatures; import io.swagger.codegen.languages.features.JaxbFeatures;
import io.swagger.codegen.languages.features.LoggingTestFeatures; import io.swagger.codegen.languages.features.LoggingTestFeatures;
import io.swagger.codegen.languages.features.UseGenericResponseFeatures;
import io.swagger.models.Operation; import io.swagger.models.Operation;
public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures implements CXFServerFeatures, GzipTestFeatures, LoggingTestFeatures, JaxbFeatures, UseGenericResponseFeatures
{ {
private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFServerCodegen.class); private static final Logger LOGGER = LoggerFactory.getLogger(JavaCXFServerCodegen.class);
@ -58,6 +59,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
protected boolean generateNonSpringApplication = false; protected boolean generateNonSpringApplication = false;
protected boolean useGenericResponse = false;
public JavaCXFServerCodegen() public JavaCXFServerCodegen()
{ {
super(); super();
@ -111,6 +114,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
cliOptions.add(CliOption.newBoolean(USE_ANNOTATED_BASE_PATH, "Use @Path annotations for basePath")); cliOptions.add(CliOption.newBoolean(USE_ANNOTATED_BASE_PATH, "Use @Path annotations for basePath"));
cliOptions.add(CliOption.newBoolean(GENERATE_NON_SPRING_APPLICATION, "Generate non-Spring application")); cliOptions.add(CliOption.newBoolean(GENERATE_NON_SPRING_APPLICATION, "Generate non-Spring application"));
cliOptions.add(CliOption.newBoolean(USE_GENERIC_RESPONSE, "Use generic response"));
} }
@ -128,6 +133,14 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
this.setAddConsumesProducesJson(convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON)); this.setAddConsumesProducesJson(convertPropertyToBooleanAndWriteBack(ADD_CONSUMES_PRODUCES_JSON));
} }
if (additionalProperties.containsKey(USE_GENERIC_RESPONSE)) {
this.setUseGenericResponse(convertPropertyToBoolean(USE_GENERIC_RESPONSE));
}
if (useGenericResponse) {
writePropertyBack(USE_GENERIC_RESPONSE, useGenericResponse);
}
if (additionalProperties.containsKey(GENERATE_SPRING_APPLICATION)) { if (additionalProperties.containsKey(GENERATE_SPRING_APPLICATION)) {
this.setGenerateSpringApplication(convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION)); this.setGenerateSpringApplication(convertPropertyToBooleanAndWriteBack(GENERATE_SPRING_APPLICATION));
@ -307,4 +320,8 @@ public class JavaCXFServerCodegen extends AbstractJavaJAXRSServerCodegen
this.generateNonSpringApplication = generateNonSpringApplication; this.generateNonSpringApplication = generateNonSpringApplication;
} }
public void setUseGenericResponse(boolean useGenericResponse) {
this.useGenericResponse = useGenericResponse;
}
} }

View File

@ -176,6 +176,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
if ("feign".equals(getLibrary())) { if ("feign".equals(getLibrary())) {
additionalProperties.put("jackson", "true"); additionalProperties.put("jackson", "true");
supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java"));
supportingFiles.add(new SupportingFile("EncodingUtils.mustache", invokerFolder, "EncodingUtils.java"));
} else if ("okhttp-gson".equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { } else if ("okhttp-gson".equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) {
// the "okhttp-gson" library template requires "ApiCallback.mustache" for async call // the "okhttp-gson" library template requires "ApiCallback.mustache" for async call
supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java")); supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java"));
@ -269,6 +270,27 @@ public class JavaClientCodegen extends AbstractJavaCodegen
} }
} }
} }
// camelize path variables for Feign client
if ("feign".equals(getLibrary())) {
Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
List<CodegenOperation> operationList = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation op : operationList) {
String path = new String(op.path);
String[] items = path.split("/", -1);
String opsPath = "";
int pathParamIndex = 0;
for (int i = 0; i < items.length; ++i) {
if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {}
// camelize path variable
items[i] = "{" + camelize(items[i].substring(1, items[i].length()-1), true) + "}";
}
}
op.path = StringUtils.join(items, "/");
}
}
return objs; return objs;
} }

View File

@ -9,6 +9,7 @@ import io.swagger.codegen.SupportingFile;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -20,6 +21,7 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
protected String groupId = "io.swagger"; protected String groupId = "io.swagger";
protected String artifactId = "swagger-scala-client"; protected String artifactId = "swagger-scala-client";
protected String artifactVersion = "1.0.0"; protected String artifactVersion = "1.0.0";
protected String clientName = "AsyncClient";
public ScalaClientCodegen() { public ScalaClientCodegen() {
super(); super();
@ -51,10 +53,13 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
additionalProperties.put("asyncHttpClient", asyncHttpClient); additionalProperties.put("asyncHttpClient", asyncHttpClient);
additionalProperties.put("authScheme", authScheme); additionalProperties.put("authScheme", authScheme);
additionalProperties.put("authPreemptive", authPreemptive); additionalProperties.put("authPreemptive", authPreemptive);
additionalProperties.put("clientName", clientName);
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")); supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml"));
supportingFiles.add(new SupportingFile("apiInvoker.mustache", supportingFiles.add(new SupportingFile("apiInvoker.mustache",
(sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), "ApiInvoker.scala")); (sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), "ApiInvoker.scala"));
supportingFiles.add(new SupportingFile("client.mustache",
(sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), clientName + ".scala"));
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));
// gradle settings // gradle settings
@ -75,8 +80,8 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
importMapping.remove("Set"); importMapping.remove("Set");
importMapping.remove("Map"); importMapping.remove("Map");
importMapping.put("DateTime", "org.joda.time.DateTime"); importMapping.put("Date", "java.util.Date");
importMapping.put("ListBuffer", "scala.collection.mutable.ListBuffer"); importMapping.put("ListBuffer", "scala.collections.mutable.ListBuffer");
typeMapping = new HashMap<String, String>(); typeMapping = new HashMap<String, String>();
typeMapping.put("enum", "NSString"); typeMapping.put("enum", "NSString");
@ -90,7 +95,6 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
typeMapping.put("byte", "Byte"); typeMapping.put("byte", "Byte");
typeMapping.put("short", "Short"); typeMapping.put("short", "Short");
typeMapping.put("char", "Char"); typeMapping.put("char", "Char");
typeMapping.put("long", "Long");
typeMapping.put("double", "Double"); typeMapping.put("double", "Double");
typeMapping.put("object", "Any"); typeMapping.put("object", "Any");
typeMapping.put("file", "File"); typeMapping.put("file", "File");
@ -98,6 +102,10 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
// mapped to String as a workaround // mapped to String as a workaround
typeMapping.put("binary", "String"); typeMapping.put("binary", "String");
typeMapping.put("ByteArray", "String"); typeMapping.put("ByteArray", "String");
typeMapping.put("date-time", "Date");
// typeMapping.put("date", "Date");
// typeMapping.put("Date", "Date");
typeMapping.put("DateTime", "Date");
instantiationTypes.put("array", "ListBuffer"); instantiationTypes.put("array", "ListBuffer");
instantiationTypes.put("map", "HashMap"); instantiationTypes.put("map", "HashMap");
@ -108,7 +116,6 @@ public class ScalaClientCodegen extends AbstractScalaCodegen implements CodegenC
@Override @Override
public void processOpts() { public void processOpts() {
super.processOpts(); super.processOpts();
if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) {
setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING));
} }

View File

@ -46,7 +46,6 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig {
protected boolean swiftUseApiNamespace; protected boolean swiftUseApiNamespace;
protected String[] responseAs = new String[0]; protected String[] responseAs = new String[0];
protected String sourceFolder = "Classes" + File.separator + "Swaggers"; protected String sourceFolder = "Classes" + File.separator + "Swaggers";
private static final Pattern PATH_PARAM_PATTERN = Pattern.compile("\\{[a-zA-Z_]+\\}");
@Override @Override
public CodegenType getTag() { public CodegenType getTag() {
@ -454,40 +453,6 @@ public class Swift3Codegen extends DefaultCodegen implements CodegenConfig {
return codegenModel; return codegenModel;
} }
@Override
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map<String, Model> definitions, Swagger swagger) {
path = normalizePath(path); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
// issue 3914 - removed logic designed to remove any parameter of type HeaderParameter
return super.fromOperation(path, httpMethod, operation, definitions, swagger);
}
private static String normalizePath(String path) {
StringBuilder builder = new StringBuilder();
int cursor = 0;
Matcher matcher = PATH_PARAM_PATTERN.matcher(path);
boolean found = matcher.find();
while (found) {
String stringBeforeMatch = path.substring(cursor, matcher.start());
builder.append(stringBeforeMatch);
String group = matcher.group().substring(1, matcher.group().length() - 1);
group = camelize(group, true);
builder
.append("{")
.append(group)
.append("}");
cursor = matcher.end();
found = matcher.find();
}
String stringAfterMatch = path.substring(cursor);
builder.append(stringAfterMatch);
return builder.toString();
}
public void setProjectName(String projectName) { public void setProjectName(String projectName) {
this.projectName = projectName; this.projectName = projectName;
} }

View File

@ -0,0 +1,9 @@
package io.swagger.codegen.languages.features;
public interface UseGenericResponseFeatures {
// Language supports generating generic Jaxrs or native return types
public static final String USE_GENERIC_RESPONSE = "useGenericResponse";
public void setUseGenericResponse(boolean useGenericResponse);
}

View File

@ -0,0 +1,86 @@
package {{invokerPackage}};
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Utilities to support Swagger encoding formats in Feign.
*/
public final class EncodingUtils {
/**
* Private constructor. Do not construct this class.
*/
private EncodingUtils() {}
/**
* <p>Encodes a collection of query parameters according to the Swagger
* collection format.</p>
*
* <p>Of the various collection formats defined by Swagger ("csv", "tsv",
* etc), Feign only natively supports "multi". This utility generates the
* other format types so it will be properly processed by Feign.</p>
*
* <p>Note, as part of reformatting, it URL encodes the parameters as
* well.</p>
* @param parameters The collection object to be formatted. This object will
* not be changed.
* @param collectionFormat The Swagger collection format (eg, "csv", "tsv",
* "pipes"). See the
* <a href="http://swagger.io/specification/#parameter-object-44">
* Swagger Spec</a> for more details.
* @return An object that will be correctly formatted by Feign.
*/
public static Object encodeCollection(Collection<?> parameters,
String collectionFormat) {
if (parameters == null) {
return parameters;
}
List<String> stringValues = new ArrayList<>(parameters.size());
for (Object parameter : parameters) {
// ignore null values (same behavior as Feign)
if (parameter != null) {
stringValues.add(encode(parameter));
}
}
// Feign natively handles single-element lists and the "multi" format.
if (stringValues.size() < 2 || "multi".equals(collectionFormat)) {
return stringValues;
}
// Otherwise return a formatted String
String[] stringArray = stringValues.toArray(new String[0]);
switch (collectionFormat) {
case "csv":
default:
return StringUtil.join(stringArray, ",");
case "ssv":
return StringUtil.join(stringArray, " ");
case "tsv":
return StringUtil.join(stringArray, "\t");
case "pipes":
return StringUtil.join(stringArray, "|");
}
}
/**
* URL encode a single query parameter.
* @param parameter The query parameter to encode. This object will not be
* changed.
* @return The URL encoded string representation of the parameter. If the
* parameter is null, returns null.
*/
public static String encode(Object parameter) {
if (parameter == null) {
return null;
}
try {
return URLEncoder.encode(parameter.toString(), "UTF-8");
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
}

View File

@ -1,6 +1,7 @@
package {{package}}; package {{package}};
import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.ApiClient;
import {{invokerPackage}}.EncodingUtils;
{{#legacyDates}} {{#legacyDates}}
import {{invokerPackage}}.ParamExpander; import {{invokerPackage}}.ParamExpander;
{{/legacyDates}} {{/legacyDates}}
@ -71,7 +72,7 @@ public interface {{classname}} extends ApiClient.Api {
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}}, "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{#hasMore}},
{{/hasMore}}{{/headerParams}} {{/hasMore}}{{/headerParams}}
}) })
{{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap Map<String, Object> queryParams); {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map<String, Object> queryParams);
/** /**
* A convenience class for generating query parameters for the * A convenience class for generating query parameters for the
@ -80,7 +81,12 @@ public interface {{classname}} extends ApiClient.Api {
public static class {{operationIdCamelCase}}QueryParams extends HashMap<String, Object> { public static class {{operationIdCamelCase}}QueryParams extends HashMap<String, Object> {
{{#queryParams}} {{#queryParams}}
public {{operationIdCamelCase}}QueryParams {{paramName}}(final {{{dataType}}} value) { public {{operationIdCamelCase}}QueryParams {{paramName}}(final {{{dataType}}} value) {
put("{{baseName}}", value); {{#collectionFormat}}
put("{{baseName}}", EncodingUtils.encodeCollection(value, "{{collectionFormat}}"));
{{/collectionFormat}}
{{^collectionFormat}}
put("{{baseName}}", EncodingUtils.encode(value));
{{/collectionFormat}}
return this; return this;
} }
{{/queryParams}} {{/queryParams}}

View File

@ -246,6 +246,18 @@
<version>${junit-version}</version> <version>${junit-version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>1.7.1</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version> <java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>

View File

@ -117,7 +117,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version> <version>3.6.1</version>
<configuration> <configuration>
{{#java8}} {{#java8}}
<source>1.8</source> <source>1.8</source>

View File

@ -117,7 +117,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.7</source> <source>1.7</source>
<target>1.7</target> <target>1.7</target>

View File

@ -118,7 +118,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
{{#java8}} {{#java8}}
<source>1.8</source> <source>1.8</source>

View File

@ -31,7 +31,7 @@ public class {{classname}}ServiceImpl implements {{classname}} {
public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
// TODO: Implement... // TODO: Implement...
{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}} {{#useGenericResponse}}return Response.ok().entity("magic!").build();{{/useGenericResponse}}{{^useGenericResponse}}{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}{{/useGenericResponse}}
} }
{{/operation}} {{/operation}}

View File

@ -26,12 +26,16 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
} }
@Override @Override
{{#jackson}}
@JsonValue @JsonValue
{{/jackson}}
public String toString() { public String toString() {
return String.valueOf(value); return String.valueOf(value);
} }
{{#jackson}}
@JsonCreator @JsonCreator
{{/jackson}}
public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) {
for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
if (String.valueOf(b.value).equals(text)) { if (String.valueOf(b.value).equals(text)) {
@ -40,4 +44,5 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
} }
return null; return null;
} }
} }

View File

@ -1 +1,4 @@
{{#returnContainer}}{{#isMapContainer}}Map<String, {{{returnType}}}>{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} {{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response:
}}{{^useGenericResponse}}{{!
}}{{#returnContainer}}{{#isMapContainer}}Map<String, {{{returnType}}}>{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{!
}}{{/useGenericResponse}}

View File

@ -104,11 +104,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source> <source>1.7</source>
1.6</source> <target>1.7</target>
<target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

View File

@ -98,10 +98,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.7</source>
<target>1.6</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -23,3 +23,4 @@ class {{clientName}}(config: SwaggerConfig) extends Closeable {
client.close() client.close()
} }
} }

View File

@ -78,10 +78,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.7</source>
<target>1.6</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -22,5 +22,5 @@ copy packages\Fody.1.29.2\Fody.dll bin\Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll
copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll
{{/generatePropertyChanged}} {{/generatePropertyChanged}}
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\IO.Swagger.dll /recurse:src\IO.Swagger\*.cs /doc:bin\IO.Swagger.xml %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml

View File

@ -7,7 +7,7 @@ wget -nc https://nuget.org/nuget.exe
mozroots --import --sync mozroots --import --sync
echo "[INFO] remove bin/Debug/SwaggerClientTest.dll" echo "[INFO] remove bin/Debug/SwaggerClientTest.dll"
rm src/IO.Swagger.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null rm src/{{{packageName}}}.Test/bin/Debug/{{{packageName}}}.Test.dll 2> /dev/null
echo "[INFO] install NUnit runners via NuGet" echo "[INFO] install NUnit runners via NuGet"
wget -nc https://nuget.org/nuget.exe wget -nc https://nuget.org/nuget.exe

View File

@ -1,10 +1,11 @@
{{>licenseInfo}} {{>licenseInfo}}
package {{package}} package {{package}}
import java.text.SimpleDateFormat
{{#imports}}import {{import}} {{#imports}}import {{import}}
{{/imports}} {{/imports}}
import {{invokerPackage}}.ApiInvoker import {{invokerPackage}}.{ApiInvoker, ApiException}
import {{invokerPackage}}.ApiException
import com.sun.jersey.multipart.FormDataMultiPart import com.sun.jersey.multipart.FormDataMultiPart
import com.sun.jersey.multipart.file.FileDataBodyPart import com.sun.jersey.multipart.file.FileDataBodyPart
@ -16,14 +17,43 @@ import java.util.Date
import scala.collection.mutable.HashMap import scala.collection.mutable.HashMap
import com.wordnik.swagger.client._
import scala.concurrent.Future
import collection.mutable
import java.net.URI
import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._
import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent._
import scala.concurrent.duration._
import scala.util.{Failure, Success, Try}
{{#operations}} {{#operations}}
class {{classname}}(val defBasePath: String = "{{{basePath}}}", class {{classname}}(val defBasePath: String = "{{{basePath}}}",
defApiInvoker: ApiInvoker = ApiInvoker) { defApiInvoker: ApiInvoker = ApiInvoker) {
implicit val formats = new org.json4s.DefaultFormats {
override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+0000")
}
implicit val stringReader = ClientResponseReaders.StringReader
implicit val unitReader = ClientResponseReaders.UnitReader
implicit val jvalueReader = ClientResponseReaders.JValueReader
implicit val jsonReader = JsonFormatsReader
implicit val stringWriter = RequestWriters.StringWriter
implicit val jsonWriter = JsonFormatsWriter
var basePath = defBasePath var basePath = defBasePath
var apiInvoker = defApiInvoker var apiInvoker = defApiInvoker
def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value def addHeader(key: String, value: String) = apiInvoker.defaultHeaders += key -> value
val config = SwaggerConfig.forUrl(new URI(defBasePath))
val client = new RestClient(config)
val helper = new {{classname}}AsyncHelper(client, config)
{{#operation}} {{#operation}}
/** /**
* {{summary}} * {{summary}}
@ -32,21 +62,45 @@ class {{classname}}(val defBasePath: String = "{{{basePath}}}",
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/ */
def {{operationId}}({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Option[{{returnType}}]{{/returnType}} = { def {{operationId}}({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Option[{{returnType}}]{{/returnType}} = {
val await = Try(Await.result({{operationId}}Async({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}), Duration.Inf))
await match {
case Success(i) => Some(await.get)
case Failure(t) => None
}
}
/**
* {{summary}} asynchronously
* {{notes}}
{{#allParams}} * @param {{paramName}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}} * @return Future({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}})
*/
def {{operationId}}Async({{#allParams}}{{paramName}}: {{#required}}{{dataType}}{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{/required}}{{^required}}Option[{{dataType}}]{{#defaultValue}} /* = {{{defaultValue}}}*/{{/defaultValue}}{{^defaultValue}} = None{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}} = {
helper.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
}
{{/operation}}
}
class {{classname}}AsyncHelper(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) {
{{#operation}}
def {{operationId}}({{#allParams}}{{^required}}{{paramName}}: Option[{{dataType}}] = {{#defaultValue}}Some({{defaultValue}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{#hasMore}},{{/hasMore}}
{{/required}}{{#required}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}},
{{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{dataType}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = {
// create path and map variables // create path and map variables
val path = "{{{path}}}".replaceAll("\\{format\\}", "json"){{#pathParams}}.replaceAll("\\{" + "{{baseName}}" + "\\}",apiInvoker.escape({{paramName}})){{/pathParams}} val path = (addFmt("{{path}}"){{#pathParams}}
replaceAll ("\\{" + "{{baseName}}" + "\\}",{{paramName}}.toString){{/pathParams}})
val contentTypes = List({{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}"application/json"{{/consumes}}) // query params
val contentType = contentTypes(0) val queryParams = new mutable.HashMap[String, String]
val headerParams = new mutable.HashMap[String, String]
val queryParams = new HashMap[String, String]
val headerParams = new HashMap[String, String]
val formParams = new HashMap[String, String]
{{#allParams}} {{#allParams}}
{{#required}} {{#required}}
{{^isPrimitiveType}} {{^isPrimitiveType}}
if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
{{/isPrimitiveType}} {{/isPrimitiveType}}
{{#isString}} {{#isString}}
if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}") if ({{paramName}} == null) throw new Exception("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
@ -55,74 +109,35 @@ class {{classname}}(val defBasePath: String = "{{{basePath}}}",
{{/required}} {{/required}}
{{/allParams}} {{/allParams}}
{{#queryParams}} {{#queryParams}}
{{^required}}
{{paramName}} match {
case Some(param) => queryParams += "{{baseName}}" -> param.toString
case _ => queryParams
}
{{/required}}
{{#required}} {{#required}}
queryParams += "{{baseName}}" -> {{paramName}}.toString queryParams += "{{baseName}}" -> {{paramName}}.toString
{{/required}} {{/required}}
{{^required}}
{{paramName}}.map(paramVal => queryParams += "{{baseName}}" -> paramVal.toString)
{{/required}}
{{/queryParams}} {{/queryParams}}
{{#headerParams}} {{#headerParams}}
{{#required}}
headerParams += "{{baseName}}" -> {{paramName}}
{{/required}}
{{^required}} {{^required}}
{{paramName}}.map(paramVal => headerParams += "{{baseName}}" -> paramVal) {{paramName}} match {
case Some(param) => headerParams += "{{baseName}}" -> param.toString
case _ => headerParams
}
{{/required}}
{{#required}}
headerParams += "{{baseName}}" -> {{paramName}}.toString
{{/required}} {{/required}}
{{/headerParams}} {{/headerParams}}
var postBody: AnyRef = {{#bodyParam}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}.map(paramVal => paramVal){{/required}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}} val resFuture = client.submit("{{httpMethod}}", path, queryParams.toMap, headerParams.toMap, {{#bodyParam}}writer.write({{paramName}}){{/bodyParam}}{{^bodyParam}}"{{emptyBodyParam}}"{{/bodyParam}})
resFuture flatMap { resp =>
if (contentType.startsWith("multipart/form-data")) { process(reader.read(resp))
val mp = new FormDataMultiPart
{{#formParams}}
{{#notFile}}
{{#required}}
mp.field("{{baseName}}", {{paramName}}.toString, MediaType.MULTIPART_FORM_DATA_TYPE)
{{/required}}
{{^required}}
{{paramName}}.map(paramVal => mp.field("{{baseName}}", paramVal.toString, MediaType.MULTIPART_FORM_DATA_TYPE))
{{/required}}
{{/notFile}}
{{#isFile}}
{{#required}}
mp.field("{{baseName}}", file.getName)
mp.bodyPart(new FileDataBodyPart("{{baseName}}", {{paramName}}, MediaType.MULTIPART_FORM_DATA_TYPE))
{{/required}}
{{^required}}
file.map(fileVal => mp.field("{{baseName}}", fileVal.getName))
{{paramName}}.map(paramVal => mp.bodyPart(new FileDataBodyPart("{{baseName}}", paramVal, MediaType.MULTIPART_FORM_DATA_TYPE)))
{{/required}}
{{/isFile}}
{{/formParams}}
postBody = mp
} else {
{{#formParams}}
{{#notFile}}
{{#required}}
formParams += "{{baseName}}" -> {{paramName}}.toString
{{/required}}
{{^required}}
{{paramName}}.map(paramVal => formParams += "{{baseName}}" -> paramVal.toString)
{{/required}}
{{/notFile}}
{{/formParams}}
}
try {
apiInvoker.invokeApi(basePath, path, "{{httpMethod}}", queryParams.toMap, formParams.toMap, postBody, headerParams.toMap, contentType) match {
case s: String =>
{{#returnType}} Some(apiInvoker.deserialize(s, "{{returnContainer}}", classOf[{{returnBaseType}}]).asInstanceOf[{{returnType}}])
{{/returnType}}
case _ => None
}
} catch {
case ex: ApiException if ex.code == 404 => None
case ex: ApiException => throw ex
} }
} }
{{/operation}} {{/operation}}
} }
{{/operations}} {{/operations}}

View File

@ -104,6 +104,12 @@ ext {
jackson_version = "2.4.2" jackson_version = "2.4.2"
junit_version = "4.8.1" junit_version = "4.8.1"
scala_test_version = "2.2.4" scala_test_version = "2.2.4"
swagger_async_httpclient_version = "0.3.5"
}
repositories {
mavenLocal()
mavenCentral()
} }
dependencies { dependencies {
@ -117,4 +123,5 @@ dependencies {
testCompile "junit:junit:$junit_version" testCompile "junit:junit:$junit_version"
compile "joda-time:joda-time:$jodatime_version" compile "joda-time:joda-time:$jodatime_version"
compile "org.joda:joda-convert:$joda_version" compile "org.joda:joda-convert:$joda_version"
compile "com.wordnik.swagger:swagger-async-httpclient_2.10:$swagger_async_httpclient_version"
} }

View File

@ -1,9 +1,10 @@
lazy val root = (project in file(".")). version := "{{artifactVersion}}"
settings(
version := "{{artifactVersion}}", name := "{{artifactId}}"
name := "{{artifactId}}",
organization := "{{groupId}}", organization := "{{groupId}}"
scalaVersion := "2.11.8",
scalaVersion := "2.11.8"
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2", "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.4.2",
@ -15,19 +16,19 @@ lazy val root = (project in file(".")).
"joda-time" % "joda-time" % "2.2", "joda-time" % "joda-time" % "2.2",
"org.joda" % "joda-convert" % "1.2", "org.joda" % "joda-convert" % "1.2",
"org.scalatest" %% "scalatest" % "2.2.4" % "test", "org.scalatest" %% "scalatest" % "2.2.4" % "test",
"junit" % "junit" % "4.8.1" % "test" "junit" % "junit" % "4.8.1" % "test",
), "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5"
)
resolvers ++= Seq( resolvers ++= Seq(
Resolver.jcenterRepo,
Resolver.mavenLocal Resolver.mavenLocal
), )
scalacOptions := Seq( scalacOptions := Seq(
"-unchecked", "-unchecked",
"-deprecation", "-deprecation",
"-feature" "-feature"
), )
publishArtifact in (Compile, packageDoc) := false publishArtifact in (Compile, packageDoc) := false
)

View File

@ -0,0 +1,22 @@
package {{invokerPackage}}
{{#imports}}import {{import}}
{{/imports}}
import {{apiPackage}}._
import com.wordnik.swagger.client._
import java.io.Closeable
class {{clientName}}(config: SwaggerConfig) extends Closeable {
val locator = config.locator
val name = config.name
private[this] val client = transportClient
protected def transportClient: TransportClient = new RestClient(config)
def close() {
client.close()
}
}

View File

@ -103,10 +103,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.7</source>
<target>1.6</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -209,6 +209,11 @@
<artifactId>joda-convert</artifactId> <artifactId>joda-convert</artifactId>
<version>${joda-version}</version> <version>${joda-version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.wordnik.swagger</groupId>
<artifactId>swagger-async-httpclient_2.10</artifactId>
<version>${swagger-async-httpclient-version}</version>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
<scala-version>2.10.4</scala-version> <scala-version>2.10.4</scala-version>
@ -223,6 +228,7 @@
<junit-version>4.8.1</junit-version> <junit-version>4.8.1</junit-version>
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version> <scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
<scala-test-version>2.2.4</scala-test-version> <scala-test-version>2.2.4</scala-test-version>
<swagger-async-httpclient-version>0.3.5</swagger-async-httpclient-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>

View File

@ -1 +1 @@
"{{baseName}}": {{paramName}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}} "{{baseName}}": {{paramName}}{{^isEnum}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{/isEnum}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}}

View File

@ -279,7 +279,7 @@ export enum {{classname}}ApiKeys {
} }
export class {{classname}} { export class {{classname}} {
protected basePath = defaultBasePath; protected _basePath = defaultBasePath;
protected defaultHeaders : any = {}; protected defaultHeaders : any = {};
protected _useQuerystring : boolean = false; protected _useQuerystring : boolean = false;
@ -326,6 +326,14 @@ export class {{classname}} {
this._useQuerystring = value; this._useQuerystring = value;
} }
set basePath(basePath: string) {
this._basePath = basePath;
}
get basePath() {
return this._basePath;
}
public setApiKey(key: {{classname}}ApiKeys, value: string) { public setApiKey(key: {{classname}}ApiKeys, value: string) {
this.authentications[{{classname}}ApiKeys[key]].apiKey = value; this.authentications[{{classname}}ApiKeys[key]].apiKey = value;
} }

View File

@ -1,6 +1,5 @@
package io.swagger.codegen; package io.swagger.codegen;
import io.swagger.models.*; import io.swagger.models.*;
import io.swagger.models.parameters.BodyParameter; import io.swagger.models.parameters.BodyParameter;
import io.swagger.models.parameters.Parameter; import io.swagger.models.parameters.Parameter;
@ -492,8 +491,7 @@ public class InlineModelResolverTest {
.vendorExtension("x-foo", "bar") .vendorExtension("x-foo", "bar")
.description("it works!") .description("it works!")
.schema(new ArrayProperty() .schema(new ArrayProperty()
.items( .items(new ObjectProperty()
new ObjectProperty()
.title("FooBar") .title("FooBar")
.property("name", new StringProperty())))))); .property("name", new StringProperty()))))));

View File

@ -4,6 +4,7 @@ import io.swagger.codegen.AbstractOptionsTest;
import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenConfig;
import io.swagger.codegen.languages.JavaCXFClientCodegen; import io.swagger.codegen.languages.JavaCXFClientCodegen;
import io.swagger.codegen.options.JavaCXFClientOptionsProvider; import io.swagger.codegen.options.JavaCXFClientOptionsProvider;
import io.swagger.codegen.options.JavaCXFServerOptionsProvider;
import io.swagger.codegen.options.OptionsProvider; import io.swagger.codegen.options.OptionsProvider;
import mockit.Expectations; import mockit.Expectations;
import mockit.Tested; import mockit.Tested;
@ -59,6 +60,9 @@ public class JaxrsCXFClientOptionsTest extends AbstractOptionsTest {
clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_BEANVALIDATION)); clientCodegen.setUseBeanValidation(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_BEANVALIDATION));
times = 1; times = 1;
clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE));
times = 1;
clientCodegen.setUseLoggingFeatureForTests( clientCodegen.setUseLoggingFeatureForTests(
Boolean.valueOf(JavaCXFClientOptionsProvider.USE_LOGGING_FEATURE_FOR_TESTS)); Boolean.valueOf(JavaCXFClientOptionsProvider.USE_LOGGING_FEATURE_FOR_TESTS));
times = 1; times = 1;

View File

@ -80,6 +80,8 @@ public class JaxrsCXFServerOptionsTest extends AbstractOptionsTest {
clientCodegen.setUseBeanValidationFeature( clientCodegen.setUseBeanValidationFeature(
Boolean.valueOf(JavaCXFServerOptionsProvider.USE_BEANVALIDATION_FEATURE)); Boolean.valueOf(JavaCXFServerOptionsProvider.USE_BEANVALIDATION_FEATURE));
times = 1; times = 1;
clientCodegen.setUseGenericResponse(Boolean.valueOf(JavaCXFServerOptionsProvider.USE_GENERIC_RESPONSE));
times = 1;
clientCodegen.setGenerateSpringBootApplication( clientCodegen.setGenerateSpringBootApplication(
Boolean.valueOf(JavaCXFServerOptionsProvider.GENERATE_SPRING_BOOT_APPLICATION)); Boolean.valueOf(JavaCXFServerOptionsProvider.GENERATE_SPRING_BOOT_APPLICATION));

View File

@ -51,7 +51,6 @@ public class JavaClientCodegenTest {
Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType)), Arrays.asList(jsonMimeType)); Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType)), Arrays.asList(jsonMimeType));
Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(vendorMimeType)), Arrays.asList(vendorMimeType)); Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(vendorMimeType)), Arrays.asList(vendorMimeType));
Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, jsonMimeType)), Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(xmlMimeType, jsonMimeType)),
Arrays.asList(jsonMimeType, xmlMimeType)); Arrays.asList(jsonMimeType, xmlMimeType));
Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, xmlMimeType)), Assert.assertEquals(JavaClientCodegen.prioritizeContentTypes(Arrays.asList(jsonMimeType, xmlMimeType)),
@ -72,8 +71,7 @@ public class JavaClientCodegenTest {
for ( int i = 0; i < 3; i++ ) for ( int i = 0; i < 3; i++ )
Assert.assertNotNull(priContentTypes.get(i).get("hasMore")); Assert.assertNotNull(priContentTypes.get(i).get("hasMore"));
Assert.assertNull(priContentTypes.get(3).get("hasMore")); Assert.assertNull(priContentTypes.get(3).get("hasMore"));
} }
} }

View File

@ -16,6 +16,8 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider {
public static final String USE_LOGGING_FEATURE_FOR_TESTS = "true"; public static final String USE_LOGGING_FEATURE_FOR_TESTS = "true";
public static final String USE_GENERIC_RESPONSE = "true";
@Override @Override
public boolean isServer() { public boolean isServer() {
@ -36,6 +38,7 @@ public class JavaCXFClientOptionsProvider extends JavaOptionsProvider {
.putAll(parentOptions); .putAll(parentOptions);
builder.put(JavaCXFClientCodegen.USE_BEANVALIDATION, JavaCXFClientOptionsProvider.USE_BEANVALIDATION); builder.put(JavaCXFClientCodegen.USE_BEANVALIDATION, JavaCXFClientOptionsProvider.USE_BEANVALIDATION);
builder.put(JavaCXFClientCodegen.USE_GENERIC_RESPONSE, JavaCXFClientOptionsProvider.USE_GENERIC_RESPONSE);
builder.put(JavaCXFClientCodegen.USE_JAXB_ANNOTATIONS, USE_JAXB_ANNOTATIONS); builder.put(JavaCXFClientCodegen.USE_JAXB_ANNOTATIONS, USE_JAXB_ANNOTATIONS);
builder.put(JavaCXFClientCodegen.USE_GZIP_FEATURE_FOR_TESTS, USE_GZIP_FEATURE_FOR_TESTS); builder.put(JavaCXFClientCodegen.USE_GZIP_FEATURE_FOR_TESTS, USE_GZIP_FEATURE_FOR_TESTS);

View File

@ -31,6 +31,8 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider {
public static final String USE_BEANVALIDATION_FEATURE = "true"; public static final String USE_BEANVALIDATION_FEATURE = "true";
public static final String USE_GENERIC_RESPONSE = "true";
public static final String USE_SPRING_ANNOTATION_CONFIG = "true"; public static final String USE_SPRING_ANNOTATION_CONFIG = "true";
public static final String GENERATE_SPRING_BOOT_APPLICATION = "true"; public static final String GENERATE_SPRING_BOOT_APPLICATION = "true";
@ -82,6 +84,7 @@ public class JavaCXFServerOptionsProvider extends JavaOptionsProvider {
builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE, USE_LOGGING_FEATURE); builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE, USE_LOGGING_FEATURE);
builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE_FOR_TESTS, USE_LOGGING_FEATURE_FOR_TESTS); builder.put(JavaCXFServerCodegen.USE_LOGGING_FEATURE_FOR_TESTS, USE_LOGGING_FEATURE_FOR_TESTS);
builder.put(JavaCXFServerCodegen.USE_BEANVALIDATION_FEATURE, USE_BEANVALIDATION_FEATURE); builder.put(JavaCXFServerCodegen.USE_BEANVALIDATION_FEATURE, USE_BEANVALIDATION_FEATURE);
builder.put(JavaCXFServerCodegen.USE_GENERIC_RESPONSE, USE_GENERIC_RESPONSE);
builder.put(JavaCXFServerCodegen.GENERATE_SPRING_BOOT_APPLICATION, GENERATE_SPRING_BOOT_APPLICATION); builder.put(JavaCXFServerCodegen.GENERATE_SPRING_BOOT_APPLICATION, GENERATE_SPRING_BOOT_APPLICATION);

View File

@ -66,10 +66,10 @@ public class ScalaModelTest {
Assert.assertEquals(property3.baseName, "createdAt"); Assert.assertEquals(property3.baseName, "createdAt");
Assert.assertEquals(property3.getter, "getCreatedAt"); Assert.assertEquals(property3.getter, "getCreatedAt");
Assert.assertEquals(property3.setter, "setCreatedAt"); Assert.assertEquals(property3.setter, "setCreatedAt");
Assert.assertEquals(property3.datatype, "DateTime"); Assert.assertEquals(property3.datatype, "Date");
Assert.assertEquals(property3.name, "createdAt"); Assert.assertEquals(property3.name, "createdAt");
Assert.assertEquals(property3.defaultValue, "null"); Assert.assertEquals(property3.defaultValue, "null");
Assert.assertEquals(property3.baseType, "DateTime"); Assert.assertEquals(property3.baseType, "Date");
Assert.assertFalse(property3.hasMore); Assert.assertFalse(property3.hasMore);
Assert.assertFalse(property3.required); Assert.assertFalse(property3.required);
Assert.assertTrue(property3.isNotContainer); Assert.assertTrue(property3.isNotContainer);

View File

@ -324,7 +324,7 @@ paths:
$ref: '#/definitions/Order' $ref: '#/definitions/Order'
'400': '400':
description: Invalid Order description: Invalid Order
'/store/order/{orderId}': '/store/order/{order_id}':
get: get:
tags: tags:
- store - store
@ -335,7 +335,7 @@ paths:
- application/xml - application/xml
- application/json - application/json
parameters: parameters:
- name: orderId - name: order_id
in: path in: path
description: ID of pet that needs to be fetched description: ID of pet that needs to be fetched
required: true required: true
@ -362,7 +362,7 @@ paths:
- application/xml - application/xml
- application/json - application/json
parameters: parameters:
- name: orderId - name: order_id
in: path in: path
description: ID of the order that needs to be deleted description: ID of the order that needs to be deleted
required: true required: true

View File

@ -27,6 +27,7 @@ import java.io.InputStream;
{{^supportJava6}} {{^supportJava6}}
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
{{/supportJava6}} {{/supportJava6}}
{{#supportJava6}} {{#supportJava6}}
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
@ -581,7 +582,7 @@ public class ApiClient {
try { try {
File file = prepareDownloadFile(response); File file = prepareDownloadFile(response);
{{^supportJava6}} {{^supportJava6}}
Files.copy(response.readEntity(InputStream.class), file.toPath()); Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
{{/supportJava6}} {{/supportJava6}}
{{#supportJava6}} {{#supportJava6}}
// Java6 falls back to commons.io for file copying // Java6 falls back to commons.io for file copying

View File

@ -155,7 +155,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.7</source> <source>1.7</source>
<target>1.7</target> <target>1.7</target>

View File

@ -104,11 +104,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source> <source>1.7</source>
1.6</source> <target>1.7</target>
<target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

View File

@ -98,10 +98,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.6</source> <source>1.7</source>
<target>1.6</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -25,3 +25,4 @@ class SwaggerClient(config: SwaggerConfig) extends Closeable {
client.close() client.close()
} }
} }

View File

@ -412,7 +412,7 @@ case $state in
deleteOrder) deleteOrder)
local -a _op_arguments local -a _op_arguments
_op_arguments=( _op_arguments=(
"orderId=:[PATH] ID of the order that needs to be deleted" "order_id=:[PATH] ID of the order that needs to be deleted"
) )
_describe -t actions 'operations' _op_arguments -S '' && ret=0 _describe -t actions 'operations' _op_arguments -S '' && ret=0
;; ;;
@ -425,7 +425,7 @@ case $state in
getOrderById) getOrderById)
local -a _op_arguments local -a _op_arguments
_op_arguments=( _op_arguments=(
"orderId=:[PATH] ID of pet that needs to be fetched" "order_id=:[PATH] ID of pet that needs to be fetched"
) )
_describe -t actions 'operations' _op_arguments -S '' && ret=0 _describe -t actions 'operations' _op_arguments -S '' && ret=0
;; ;;

View File

@ -103,8 +103,8 @@ operation_parameters_minimum_occurences["updatePetWithForm:::status"]=0
operation_parameters_minimum_occurences["uploadFile:::petId"]=1 operation_parameters_minimum_occurences["uploadFile:::petId"]=1
operation_parameters_minimum_occurences["uploadFile:::additionalMetadata"]=0 operation_parameters_minimum_occurences["uploadFile:::additionalMetadata"]=0
operation_parameters_minimum_occurences["uploadFile:::file"]=0 operation_parameters_minimum_occurences["uploadFile:::file"]=0
operation_parameters_minimum_occurences["deleteOrder:::orderId"]=1 operation_parameters_minimum_occurences["deleteOrder:::order_id"]=1
operation_parameters_minimum_occurences["getOrderById:::orderId"]=1 operation_parameters_minimum_occurences["getOrderById:::order_id"]=1
operation_parameters_minimum_occurences["placeOrder:::body"]=1 operation_parameters_minimum_occurences["placeOrder:::body"]=1
operation_parameters_minimum_occurences["createUser:::body"]=1 operation_parameters_minimum_occurences["createUser:::body"]=1
operation_parameters_minimum_occurences["createUsersWithArrayInput:::body"]=1 operation_parameters_minimum_occurences["createUsersWithArrayInput:::body"]=1
@ -160,8 +160,8 @@ operation_parameters_maximum_occurences["updatePetWithForm:::status"]=0
operation_parameters_maximum_occurences["uploadFile:::petId"]=0 operation_parameters_maximum_occurences["uploadFile:::petId"]=0
operation_parameters_maximum_occurences["uploadFile:::additionalMetadata"]=0 operation_parameters_maximum_occurences["uploadFile:::additionalMetadata"]=0
operation_parameters_maximum_occurences["uploadFile:::file"]=0 operation_parameters_maximum_occurences["uploadFile:::file"]=0
operation_parameters_maximum_occurences["deleteOrder:::orderId"]=0 operation_parameters_maximum_occurences["deleteOrder:::order_id"]=0
operation_parameters_maximum_occurences["getOrderById:::orderId"]=0 operation_parameters_maximum_occurences["getOrderById:::order_id"]=0
operation_parameters_maximum_occurences["placeOrder:::body"]=0 operation_parameters_maximum_occurences["placeOrder:::body"]=0
operation_parameters_maximum_occurences["createUser:::body"]=0 operation_parameters_maximum_occurences["createUser:::body"]=0
operation_parameters_maximum_occurences["createUsersWithArrayInput:::body"]=0 operation_parameters_maximum_occurences["createUsersWithArrayInput:::body"]=0
@ -214,8 +214,8 @@ operation_parameters_collection_type["updatePetWithForm:::status"]=""
operation_parameters_collection_type["uploadFile:::petId"]="" operation_parameters_collection_type["uploadFile:::petId"]=""
operation_parameters_collection_type["uploadFile:::additionalMetadata"]="" operation_parameters_collection_type["uploadFile:::additionalMetadata"]=""
operation_parameters_collection_type["uploadFile:::file"]="" operation_parameters_collection_type["uploadFile:::file"]=""
operation_parameters_collection_type["deleteOrder:::orderId"]="" operation_parameters_collection_type["deleteOrder:::order_id"]=""
operation_parameters_collection_type["getOrderById:::orderId"]="" operation_parameters_collection_type["getOrderById:::order_id"]=""
operation_parameters_collection_type["placeOrder:::body"]="" operation_parameters_collection_type["placeOrder:::body"]=""
operation_parameters_collection_type["createUser:::body"]="" operation_parameters_collection_type["createUser:::body"]=""
operation_parameters_collection_type["createUsersWithArrayInput:::body"]= operation_parameters_collection_type["createUsersWithArrayInput:::body"]=
@ -1434,7 +1434,7 @@ print_deleteOrder_help() {
echo -e "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" | fold -sw 80 echo -e "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" | fold -sw 80
echo -e "" echo -e ""
echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)" echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)"
echo -e " * $(tput setaf 2)orderId$(tput sgr0) $(tput setaf 4)[String]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of the order that needs to be deleted $(tput setaf 3)Specify as: orderId=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' echo -e " * $(tput setaf 2)order_id$(tput sgr0) $(tput setaf 4)[String]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of the order that needs to be deleted $(tput setaf 3)Specify as: order_id=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /'
echo "" echo ""
echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)" echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)"
case 400 in case 400 in
@ -1524,7 +1524,7 @@ print_getOrderById_help() {
echo -e "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions" | fold -sw 80 echo -e "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions" | fold -sw 80
echo -e "" echo -e ""
echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)" echo -e "$(tput bold)$(tput setaf 7)Parameters$(tput sgr0)"
echo -e " * $(tput setaf 2)orderId$(tput sgr0) $(tput setaf 4)[Integer]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of pet that needs to be fetched $(tput setaf 3)Specify as: orderId=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /' echo -e " * $(tput setaf 2)order_id$(tput sgr0) $(tput setaf 4)[Integer]$(tput sgr0) $(tput setaf 1)(required)$(tput sgr0)$(tput sgr0) - ID of pet that needs to be fetched $(tput setaf 3)Specify as: order_id=value$(tput sgr0)" | fold -sw 80 | sed '2,$s/^/ /'
echo "" echo ""
echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)" echo -e "$(tput bold)$(tput setaf 7)Responses$(tput sgr0)"
case 200 in case 200 in
@ -2586,14 +2586,14 @@ call_uploadFile() {
# #
############################################################################## ##############################################################################
call_deleteOrder() { call_deleteOrder() {
local path_parameter_names=(orderId) local path_parameter_names=(order_id)
local query_parameter_names=() local query_parameter_names=()
if [[ $force = false ]]; then if [[ $force = false ]]; then
validate_request_parameters "/v2/store/order/{orderId}" path_parameter_names query_parameter_names validate_request_parameters "/v2/store/order/{order_id}" path_parameter_names query_parameter_names
fi fi
local path=$(build_request_path "/v2/store/order/{orderId}" path_parameter_names query_parameter_names) local path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names)
local method="DELETE" local method="DELETE"
local headers_curl=$(header_arguments_to_curl) local headers_curl=$(header_arguments_to_curl)
if [[ -n $header_accept ]]; then if [[ -n $header_accept ]]; then
@ -2648,14 +2648,14 @@ call_getInventory() {
# #
############################################################################## ##############################################################################
call_getOrderById() { call_getOrderById() {
local path_parameter_names=(orderId) local path_parameter_names=(order_id)
local query_parameter_names=() local query_parameter_names=()
if [[ $force = false ]]; then if [[ $force = false ]]; then
validate_request_parameters "/v2/store/order/{orderId}" path_parameter_names query_parameter_names validate_request_parameters "/v2/store/order/{order_id}" path_parameter_names query_parameter_names
fi fi
local path=$(build_request_path "/v2/store/order/{orderId}" path_parameter_names query_parameter_names) local path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names)
local method="GET" local method="GET"
local headers_curl=$(header_arguments_to_curl) local headers_curl=$(header_arguments_to_curl)
if [[ -n $header_accept ]]; then if [[ -n $header_accept ]]; then

View File

@ -108,9 +108,9 @@ _petstore-cli()
operation_parameters["updatePet"]="" operation_parameters["updatePet"]=""
operation_parameters["updatePetWithForm"]="petId= " operation_parameters["updatePetWithForm"]="petId= "
operation_parameters["uploadFile"]="petId= " operation_parameters["uploadFile"]="petId= "
operation_parameters["deleteOrder"]="orderId= " operation_parameters["deleteOrder"]="order_id= "
operation_parameters["getInventory"]="" operation_parameters["getInventory"]=""
operation_parameters["getOrderById"]="orderId= " operation_parameters["getOrderById"]="order_id= "
operation_parameters["placeOrder"]="" operation_parameters["placeOrder"]=""
operation_parameters["createUser"]="" operation_parameters["createUser"]=""
operation_parameters["createUsersWithArrayInput"]="" operation_parameters["createUsersWithArrayInput"]=""

View File

@ -84,9 +84,9 @@ Class | Method | HTTP request | Description
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet

View File

@ -241,7 +241,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "./store/order/{orderId}"; var localVarPath = "./store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -263,7 +263,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request
@ -376,7 +376,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "./store/order/{orderId}"; var localVarPath = "./store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -398,7 +398,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request

View File

@ -105,9 +105,9 @@ Class | Method | HTTP request | Description
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet

View File

@ -325,7 +325,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -347,7 +347,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request
@ -393,7 +393,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -415,7 +415,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request
@ -595,7 +595,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -617,7 +617,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request
@ -664,7 +664,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -686,7 +686,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request

View File

@ -105,9 +105,9 @@ Class | Method | HTTP request | Description
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
[**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
[**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet

View File

@ -325,7 +325,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -347,7 +347,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request
@ -393,7 +393,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -415,7 +415,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request
@ -595,7 +595,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -617,7 +617,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request
@ -664,7 +664,7 @@ namespace IO.Swagger.Api
if (orderId == null) if (orderId == null)
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
var localVarPath = "/store/order/{orderId}"; var localVarPath = "/store/order/{order_id}";
var localVarPathParams = new Dictionary<String, String>(); var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<String, String>(); var localVarQueryParams = new Dictionary<String, String>();
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader); var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
@ -686,7 +686,7 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null) if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request // make the HTTP request

View File

@ -33,9 +33,9 @@ Class | Method | HTTP request | Description
*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet
*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image
*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status
*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID
*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet *StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet
*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user *UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user
*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array *UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{orderId} | Delete purchase order by ID [**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID
[**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status [**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status
[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{orderId} | Find purchase order by ID [**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID
[**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet [**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet

View File

@ -48,8 +48,8 @@ func (a StoreApi) DeleteOrder(orderId string) (*APIResponse, error) {
var localVarHttpMethod = strings.ToUpper("Delete") var localVarHttpMethod = strings.ToUpper("Delete")
// create path and map variables // create path and map variables
localVarPath := a.Configuration.BasePath + "/store/order/{orderId}" localVarPath := a.Configuration.BasePath + "/store/order/{order_id}"
localVarPath = strings.Replace(localVarPath, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1)
localVarHeaderParams := make(map[string]string) localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{} localVarQueryParams := url.Values{}
@ -170,8 +170,8 @@ func (a StoreApi) GetOrderById(orderId int64) (*Order, *APIResponse, error) {
var localVarHttpMethod = strings.ToUpper("Get") var localVarHttpMethod = strings.ToUpper("Get")
// create path and map variables // create path and map variables
localVarPath := a.Configuration.BasePath + "/store/order/{orderId}" localVarPath := a.Configuration.BasePath + "/store/order/{order_id}"
localVarPath = strings.Replace(localVarPath, "{"+"orderId"+"}", fmt.Sprintf("%v", orderId), -1) localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", fmt.Sprintf("%v", orderId), -1)
localVarHeaderParams := make(map[string]string) localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{} localVarQueryParams := url.Values{}

View File

@ -230,6 +230,18 @@
<version>${junit-version}</version> <version>${junit-version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>3.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>1.7.1</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
<java.version>1.7</java.version> <java.version>1.7</java.version>

View File

@ -0,0 +1,86 @@
package io.swagger.client;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Utilities to support Swagger encoding formats in Feign.
*/
public final class EncodingUtils {
/**
* Private constructor. Do not construct this class.
*/
private EncodingUtils() {}
/**
* <p>Encodes a collection of query parameters according to the Swagger
* collection format.</p>
*
* <p>Of the various collection formats defined by Swagger ("csv", "tsv",
* etc), Feign only natively supports "multi". This utility generates the
* other format types so it will be properly processed by Feign.</p>
*
* <p>Note, as part of reformatting, it URL encodes the parameters as
* well.</p>
* @param parameters The collection object to be formatted. This object will
* not be changed.
* @param collectionFormat The Swagger collection format (eg, "csv", "tsv",
* "pipes"). See the
* <a href="http://swagger.io/specification/#parameter-object-44">
* Swagger Spec</a> for more details.
* @return An object that will be correctly formatted by Feign.
*/
public static Object encodeCollection(Collection<?> parameters,
String collectionFormat) {
if (parameters == null) {
return parameters;
}
List<String> stringValues = new ArrayList<>(parameters.size());
for (Object parameter : parameters) {
// ignore null values (same behavior as Feign)
if (parameter != null) {
stringValues.add(encode(parameter));
}
}
// Feign natively handles single-element lists and the "multi" format.
if (stringValues.size() < 2 || "multi".equals(collectionFormat)) {
return stringValues;
}
// Otherwise return a formatted String
String[] stringArray = stringValues.toArray(new String[0]);
switch (collectionFormat) {
case "csv":
default:
return StringUtil.join(stringArray, ",");
case "ssv":
return StringUtil.join(stringArray, " ");
case "tsv":
return StringUtil.join(stringArray, "\t");
case "pipes":
return StringUtil.join(stringArray, "|");
}
}
/**
* URL encode a single query parameter.
* @param parameter The query parameter to encode. This object will not be
* changed.
* @return The URL encoded string representation of the parameter. If the
* parameter is null, returns null.
*/
public static String encode(Object parameter) {
if (parameter == null) {
return null;
}
try {
return URLEncoder.encode(parameter.toString(), "UTF-8");
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
}

View File

@ -1,6 +1,7 @@
package io.swagger.client.api; package io.swagger.client.api;
import io.swagger.client.ApiClient; import io.swagger.client.ApiClient;
import io.swagger.client.EncodingUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import io.swagger.client.model.Client; import io.swagger.client.model.Client;
@ -106,7 +107,7 @@ public interface FakeApi extends ApiClient.Api {
"enum_header_string: {enumHeaderString}" "enum_header_string: {enumHeaderString}"
}) })
void testEnumParameters(@Param("enumFormStringArray") List<String> enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List<String> enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap Map<String, Object> queryParams); void testEnumParameters(@Param("enumFormStringArray") List<String> enumFormStringArray, @Param("enumFormString") String enumFormString, @Param("enumHeaderStringArray") List<String> enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryDouble") Double enumQueryDouble, @QueryMap(encoded=true) Map<String, Object> queryParams);
/** /**
* A convenience class for generating query parameters for the * A convenience class for generating query parameters for the
@ -114,15 +115,15 @@ public interface FakeApi extends ApiClient.Api {
*/ */
public static class TestEnumParametersQueryParams extends HashMap<String, Object> { public static class TestEnumParametersQueryParams extends HashMap<String, Object> {
public TestEnumParametersQueryParams enumQueryStringArray(final List<String> value) { public TestEnumParametersQueryParams enumQueryStringArray(final List<String> value) {
put("enum_query_string_array", value); put("enum_query_string_array", EncodingUtils.encodeCollection(value, "csv"));
return this; return this;
} }
public TestEnumParametersQueryParams enumQueryString(final String value) { public TestEnumParametersQueryParams enumQueryString(final String value) {
put("enum_query_string", value); put("enum_query_string", EncodingUtils.encode(value));
return this; return this;
} }
public TestEnumParametersQueryParams enumQueryInteger(final Integer value) { public TestEnumParametersQueryParams enumQueryInteger(final Integer value) {
put("enum_query_integer", value); put("enum_query_integer", EncodingUtils.encode(value));
return this; return this;
} }
} }

View File

@ -1,6 +1,7 @@
package io.swagger.client.api; package io.swagger.client.api;
import io.swagger.client.ApiClient; import io.swagger.client.ApiClient;
import io.swagger.client.EncodingUtils;
import java.io.File; import java.io.File;
import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.ModelApiResponse;
@ -75,7 +76,7 @@ public interface PetApi extends ApiClient.Api {
"Content-Type: application/json", "Content-Type: application/json",
"Accept: application/json", "Accept: application/json",
}) })
List<Pet> findPetsByStatus(@QueryMap Map<String, Object> queryParams); List<Pet> findPetsByStatus(@QueryMap(encoded=true) Map<String, Object> queryParams);
/** /**
* A convenience class for generating query parameters for the * A convenience class for generating query parameters for the
@ -83,7 +84,7 @@ public interface PetApi extends ApiClient.Api {
*/ */
public static class FindPetsByStatusQueryParams extends HashMap<String, Object> { public static class FindPetsByStatusQueryParams extends HashMap<String, Object> {
public FindPetsByStatusQueryParams status(final List<String> value) { public FindPetsByStatusQueryParams status(final List<String> value) {
put("status", value); put("status", EncodingUtils.encodeCollection(value, "csv"));
return this; return this;
} }
} }
@ -121,7 +122,7 @@ public interface PetApi extends ApiClient.Api {
"Content-Type: application/json", "Content-Type: application/json",
"Accept: application/json", "Accept: application/json",
}) })
List<Pet> findPetsByTags(@QueryMap Map<String, Object> queryParams); List<Pet> findPetsByTags(@QueryMap(encoded=true) Map<String, Object> queryParams);
/** /**
* A convenience class for generating query parameters for the * A convenience class for generating query parameters for the
@ -129,7 +130,7 @@ public interface PetApi extends ApiClient.Api {
*/ */
public static class FindPetsByTagsQueryParams extends HashMap<String, Object> { public static class FindPetsByTagsQueryParams extends HashMap<String, Object> {
public FindPetsByTagsQueryParams tags(final List<String> value) { public FindPetsByTagsQueryParams tags(final List<String> value) {
put("tags", value); put("tags", EncodingUtils.encodeCollection(value, "csv"));
return this; return this;
} }
} }

View File

@ -1,6 +1,7 @@
package io.swagger.client.api; package io.swagger.client.api;
import io.swagger.client.ApiClient; import io.swagger.client.ApiClient;
import io.swagger.client.EncodingUtils;
import io.swagger.client.model.Order; import io.swagger.client.model.Order;

View File

@ -1,6 +1,7 @@
package io.swagger.client.api; package io.swagger.client.api;
import io.swagger.client.ApiClient; import io.swagger.client.ApiClient;
import io.swagger.client.EncodingUtils;
import io.swagger.client.model.User; import io.swagger.client.model.User;
@ -110,7 +111,7 @@ public interface UserApi extends ApiClient.Api {
"Content-Type: application/json", "Content-Type: application/json",
"Accept: application/json", "Accept: application/json",
}) })
String loginUser(@QueryMap Map<String, Object> queryParams); String loginUser(@QueryMap(encoded=true) Map<String, Object> queryParams);
/** /**
* A convenience class for generating query parameters for the * A convenience class for generating query parameters for the
@ -118,11 +119,11 @@ public interface UserApi extends ApiClient.Api {
*/ */
public static class LoginUserQueryParams extends HashMap<String, Object> { public static class LoginUserQueryParams extends HashMap<String, Object> {
public LoginUserQueryParams username(final String value) { public LoginUserQueryParams username(final String value) {
put("username", value); put("username", EncodingUtils.encode(value));
return this; return this;
} }
public LoginUserQueryParams password(final String value) { public LoginUserQueryParams password(final String value) {
put("password", value); put("password", EncodingUtils.encode(value));
return this; return this;
} }
} }

View File

@ -13,17 +13,25 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.*; import org.junit.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.*; import static org.junit.Assert.*;
public class PetApiTest { public class PetApiTest {
private ApiClient apiClient; ApiClient apiClient;
private PetApi api; PetApi api;
MockWebServer localServer;
ApiClient localClient;
@Before @Before
public void setup() { public void setup() {
apiClient = new ApiClient(); apiClient = new ApiClient();
api = apiClient.buildClient(PetApi.class); api = apiClient.buildClient(PetApi.class);
localServer = new MockWebServer();
localClient = new ApiClient();
} }
@Test @Test
@ -211,6 +219,20 @@ public class PetApiTest {
assertTrue(pet1.hashCode() == pet1.hashCode()); assertTrue(pet1.hashCode() == pet1.hashCode());
} }
@Test
public void testCSVDelimitedArray() throws Exception {
localServer.enqueue(new MockResponse().setBody("[{\"id\":5,\"name\":\"rocky\"}]"));
localServer.start();
PetApi api = localClient.setBasePath(localServer.url("/").toString()).buildClient(PetApi.class);
PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams()
.tags(Arrays.asList("friendly","energetic"));
List<Pet> pets = api.findPetsByTags(queryParams);
assertNotNull(pets);
RecordedRequest request = localServer.takeRequest();
assertThat(request.getPath()).contains("tags=friendly,energetic");
localServer.shutdown();
}
private Pet createRandomPet() { private Pet createRandomPet() {
Pet pet = new Pet(); Pet pet = new Pet();
pet.setId(TestUtils.nextId()); pet.setId(TestUtils.nextId());

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -118,7 +118,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.7</source> <source>1.7</source>
<target>1.7</target> <target>1.7</target>

View File

@ -63,8 +63,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();
@ -140,8 +140,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -117,7 +117,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.7</source> <source>1.7</source>
<target>1.7</target> <target>1.7</target>

View File

@ -49,8 +49,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();
@ -126,8 +126,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -117,7 +117,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>

View File

@ -49,8 +49,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();
@ -126,8 +126,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -117,7 +117,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.7</source> <source>1.7</source>
<target>1.7</target> <target>1.7</target>

View File

@ -49,8 +49,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();
@ -126,8 +126,8 @@ public class StoreApi {
} }
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
// query params // query params
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -516,12 +516,13 @@ public class ApiClient {
* application/json * application/json
* application/json; charset=UTF8 * application/json; charset=UTF8
* APPLICATION/JSON * APPLICATION/JSON
* * application/vnd.company+json
* @param mime MIME (Multipurpose Internet Mail Extensions) * @param mime MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise. * @return True if the given MIME is JSON, false otherwise.
*/ */
public boolean isJsonMime(String mime) { public boolean isJsonMime(String mime) {
return mime != null && mime.matches("(?i)application\\/json(;.*)?"); String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && mime.matches(jsonMime);
} }
/** /**

View File

@ -66,8 +66,8 @@ public class StoreApi {
Object localVarPostBody = null; Object localVarPostBody = null;
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();
@ -304,8 +304,8 @@ public class StoreApi {
Object localVarPostBody = null; Object localVarPostBody = null;
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -66,8 +66,8 @@ public class StoreApi {
Object localVarPostBody = null; Object localVarPostBody = null;
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();
@ -304,8 +304,8 @@ public class StoreApi {
Object localVarPostBody = null; Object localVarPostBody = null;
// create path and map variables // create path and map variables
String localVarPath = "/store/order/{orderId}" String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString())); .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarQueryParams = new ArrayList<Pair>();

View File

@ -117,7 +117,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>3.6.1</version>
<configuration> <configuration>
<source>1.7</source> <source>1.7</source>
<target>1.7</target> <target>1.7</target>

View File

@ -22,9 +22,9 @@ public interface StoreApi {
* @return Void * @return Void
*/ */
@DELETE("/store/order/{orderId}") @DELETE("/store/order/{order_id}")
Void deleteOrder( Void deleteOrder(
@retrofit.http.Path("orderId") String orderId @retrofit.http.Path("order_id") String orderId
); );
/** /**
@ -34,9 +34,9 @@ public interface StoreApi {
* @param cb callback method * @param cb callback method
*/ */
@DELETE("/store/order/{orderId}") @DELETE("/store/order/{order_id}")
void deleteOrder( void deleteOrder(
@retrofit.http.Path("orderId") String orderId, Callback<Void> cb @retrofit.http.Path("order_id") String orderId, Callback<Void> cb
); );
/** /**
* Returns pet inventories by status * Returns pet inventories by status
@ -67,9 +67,9 @@ public interface StoreApi {
* @return Order * @return Order
*/ */
@GET("/store/order/{orderId}") @GET("/store/order/{order_id}")
Order getOrderById( Order getOrderById(
@retrofit.http.Path("orderId") Long orderId @retrofit.http.Path("order_id") Long orderId
); );
/** /**
@ -79,9 +79,9 @@ public interface StoreApi {
* @param cb callback method * @param cb callback method
*/ */
@GET("/store/order/{orderId}") @GET("/store/order/{order_id}")
void getOrderById( void getOrderById(
@retrofit.http.Path("orderId") Long orderId, Callback<Order> cb @retrofit.http.Path("order_id") Long orderId, Callback<Order> cb
); );
/** /**
* Place an order for a pet * Place an order for a pet

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet

View File

@ -26,9 +26,9 @@ public interface StoreApi {
* @param orderId ID of the order that needs to be deleted (required) * @param orderId ID of the order that needs to be deleted (required)
* @return Call&lt;Void&gt; * @return Call&lt;Void&gt;
*/ */
@DELETE("store/order/{orderId}") @DELETE("store/order/{order_id}")
F.Promise<Response<Void>> deleteOrder( F.Promise<Response<Void>> deleteOrder(
@retrofit2.http.Path("orderId") String orderId @retrofit2.http.Path("order_id") String orderId
); );
/** /**
@ -46,9 +46,9 @@ public interface StoreApi {
* @param orderId ID of pet that needs to be fetched (required) * @param orderId ID of pet that needs to be fetched (required)
* @return Call&lt;Order&gt; * @return Call&lt;Order&gt;
*/ */
@GET("store/order/{orderId}") @GET("store/order/{order_id}")
F.Promise<Response<Order>> getOrderById( F.Promise<Response<Order>> getOrderById(
@retrofit2.http.Path("orderId") Long orderId @retrofit2.http.Path("order_id") Long orderId
); );
/** /**

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet

View File

@ -24,9 +24,9 @@ public interface StoreApi {
* @param orderId ID of the order that needs to be deleted (required) * @param orderId ID of the order that needs to be deleted (required)
* @return Call&lt;Void&gt; * @return Call&lt;Void&gt;
*/ */
@DELETE("store/order/{orderId}") @DELETE("store/order/{order_id}")
Call<Void> deleteOrder( Call<Void> deleteOrder(
@retrofit2.http.Path("orderId") String orderId @retrofit2.http.Path("order_id") String orderId
); );
/** /**
@ -44,9 +44,9 @@ public interface StoreApi {
* @param orderId ID of pet that needs to be fetched (required) * @param orderId ID of pet that needs to be fetched (required)
* @return Call&lt;Order&gt; * @return Call&lt;Order&gt;
*/ */
@GET("store/order/{orderId}") @GET("store/order/{order_id}")
Call<Order> getOrderById( Call<Order> getOrderById(
@retrofit2.http.Path("orderId") Long orderId @retrofit2.http.Path("order_id") Long orderId
); );
/** /**

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet

View File

@ -24,9 +24,9 @@ public interface StoreApi {
* @param orderId ID of the order that needs to be deleted (required) * @param orderId ID of the order that needs to be deleted (required)
* @return Call&lt;Void&gt; * @return Call&lt;Void&gt;
*/ */
@DELETE("store/order/{orderId}") @DELETE("store/order/{order_id}")
Observable<Void> deleteOrder( Observable<Void> deleteOrder(
@retrofit2.http.Path("orderId") String orderId @retrofit2.http.Path("order_id") String orderId
); );
/** /**
@ -44,9 +44,9 @@ public interface StoreApi {
* @param orderId ID of pet that needs to be fetched (required) * @param orderId ID of pet that needs to be fetched (required)
* @return Call&lt;Order&gt; * @return Call&lt;Order&gt;
*/ */
@GET("store/order/{orderId}") @GET("store/order/{order_id}")
Observable<Order> getOrderById( Observable<Order> getOrderById(
@retrofit2.http.Path("orderId") Long orderId @retrofit2.http.Path("order_id") Long orderId
); );
/** /**

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet

View File

@ -24,9 +24,9 @@ public interface StoreApi {
* @param orderId ID of the order that needs to be deleted (required) * @param orderId ID of the order that needs to be deleted (required)
* @return Call&lt;Void&gt; * @return Call&lt;Void&gt;
*/ */
@DELETE("store/order/{orderId}") @DELETE("store/order/{order_id}")
Observable<Void> deleteOrder( Observable<Void> deleteOrder(
@retrofit2.http.Path("orderId") String orderId @retrofit2.http.Path("order_id") String orderId
); );
/** /**
@ -44,9 +44,9 @@ public interface StoreApi {
* @param orderId ID of pet that needs to be fetched (required) * @param orderId ID of pet that needs to be fetched (required)
* @return Call&lt;Order&gt; * @return Call&lt;Order&gt;
*/ */
@GET("store/order/{orderId}") @GET("store/order/{order_id}")
Observable<Order> getOrderById( Observable<Order> getOrderById(
@retrofit2.http.Path("orderId") Long orderId @retrofit2.http.Path("order_id") Long orderId
); );
/** /**

View File

@ -83,9 +83,9 @@ Class | Method | HTTP request | Description
*SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
*SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
*SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image *SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status *SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID *SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
*SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
*SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
*SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array *SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array

View File

@ -1,6 +1,6 @@
# SwaggerPetstore.Fake_classname_tags123Api # SwaggerPetstore.Fake_classname_tags123Api
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -62,7 +62,7 @@
var pathParams = { var pathParams = {
'orderId': orderId 'order_id': orderId
}; };
var queryParams = { var queryParams = {
}; };
@ -79,7 +79,7 @@
var returnType = null; var returnType = null;
return this.apiClient.callApi( return this.apiClient.callApi(
'/store/order/{orderId}', 'DELETE', '/store/order/{order_id}', 'DELETE',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType authNames, contentTypes, accepts, returnType
); );
@ -160,7 +160,7 @@
var pathParams = { var pathParams = {
'orderId': orderId 'order_id': orderId
}; };
var queryParams = { var queryParams = {
}; };
@ -177,7 +177,7 @@
var returnType = Order; var returnType = Order;
return this.apiClient.callApi( return this.apiClient.callApi(
'/store/order/{orderId}', 'GET', '/store/order/{order_id}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType authNames, contentTypes, accepts, returnType
); );

View File

@ -86,9 +86,9 @@ Class | Method | HTTP request | Description
*SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *SwaggerPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
*SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *SwaggerPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
*SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image *SwaggerPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
*SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *SwaggerPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status *SwaggerPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
*SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID *SwaggerPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
*SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *SwaggerPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
*SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *SwaggerPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
*SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array *SwaggerPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array

View File

@ -1,6 +1,6 @@
# SwaggerPetstore.Fake_classname_tags123Api # SwaggerPetstore.Fake_classname_tags123Api
All URIs are relative to *http://petstore.swagger.io/v2* All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -4,9 +4,9 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

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