forked from loafle/openapi-generator-original
updated versions
This commit is contained in:
parent
33c2b1b623
commit
3d2f09a693
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<version>2.1.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<version>2.1.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<version>2.1.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>swagger-generator</artifactId>
|
||||
|
2
pom.xml
2
pom.xml
@ -10,7 +10,7 @@
|
||||
<artifactId>swagger-codegen-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>swagger-codegen-project</name>
|
||||
<version>2.1.1</version>
|
||||
<version>2.1.2</version>
|
||||
<url>https://github.com/swagger-api/swagger-codegen</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>
|
||||
|
@ -7,7 +7,9 @@ jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.2.2'
|
||||
|
||||
classpath 'com.github.dcendents:android-maven-plugin:1.2'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,8 +77,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/main/java</source>
|
||||
<source>src/main/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -90,8 +89,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/test/java</source>
|
||||
<source>src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -102,8 +100,7 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>
|
||||
1.6</source>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -53,9 +53,7 @@ import com.google.gson.JsonParseException;
|
||||
|
||||
public class ApiInvoker {
|
||||
private static ApiInvoker INSTANCE = new ApiInvoker();
|
||||
private Map
|
||||
<String, String> defaultHeaderMap = new HashMap
|
||||
<String, String>();
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
|
||||
private HttpClient client = null;
|
||||
|
||||
@ -186,10 +184,7 @@ throw new ApiException(500, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String invokeAPI(String host, String path, String method, Map
|
||||
<String, String> queryParams, Object body, Map
|
||||
<String, String> headerParams, Map
|
||||
<String, String> formParams, String contentType) throws ApiException {
|
||||
public String invokeAPI(String host, String path, String method, Map<String, String> queryParams, Object body, Map<String, String> headerParams, Map<String, String> formParams, String contentType) throws ApiException {
|
||||
HttpClient client = getClient(host);
|
||||
|
||||
StringBuilder b = new StringBuilder();
|
||||
@ -205,9 +200,7 @@ b.append(escapeString(key)).append("=").append(escapeString(value));
|
||||
}
|
||||
String url = host + path + b.toString();
|
||||
|
||||
HashMap
|
||||
<String, String> headers = new HashMap
|
||||
<String, String>();
|
||||
HashMap<String, String> headers = new HashMap<String, String>();
|
||||
|
||||
for(String key : headerParams.keySet()) {
|
||||
headers.put(key, headerParams.get(key));
|
||||
|
@ -24,13 +24,11 @@ public static String serialize(Object obj){
|
||||
return getGson().toJson(obj);
|
||||
}
|
||||
|
||||
public static
|
||||
<T> T deserializeToList(String jsonString, Class cls){
|
||||
public static <T> T deserializeToList(String jsonString, Class cls){
|
||||
return getGson().fromJson(jsonString, getListTypeForDeserialization(cls));
|
||||
}
|
||||
|
||||
public static
|
||||
<T> T deserializeToObject(String jsonString, Class cls){
|
||||
public static <T> T deserializeToObject(String jsonString, Class cls){
|
||||
return getGson().fromJson(jsonString, getTypeForDeserialization(cls));
|
||||
}
|
||||
|
||||
@ -38,38 +36,26 @@ public static
|
||||
String className = cls.getSimpleName();
|
||||
|
||||
if ("User".equalsIgnoreCase(className)) {
|
||||
return new TypeToken
|
||||
<List
|
||||
<User>>(){}.getType();
|
||||
return new TypeToken<List<User>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Category".equalsIgnoreCase(className)) {
|
||||
return new TypeToken
|
||||
<List
|
||||
<Category>>(){}.getType();
|
||||
return new TypeToken<List<Category>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Pet".equalsIgnoreCase(className)) {
|
||||
return new TypeToken
|
||||
<List
|
||||
<Pet>>(){}.getType();
|
||||
return new TypeToken<List<Pet>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Tag".equalsIgnoreCase(className)) {
|
||||
return new TypeToken
|
||||
<List
|
||||
<Tag>>(){}.getType();
|
||||
return new TypeToken<List<Tag>>(){}.getType();
|
||||
}
|
||||
|
||||
if ("Order".equalsIgnoreCase(className)) {
|
||||
return new TypeToken
|
||||
<List
|
||||
<Order>>(){}.getType();
|
||||
return new TypeToken<List<Order>>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken
|
||||
<List
|
||||
<Object>>(){}.getType();
|
||||
return new TypeToken<List<Object>>(){}.getType();
|
||||
}
|
||||
|
||||
public static Type getTypeForDeserialization(Class cls) {
|
||||
@ -95,8 +81,7 @@ public static
|
||||
return new TypeToken<Order>(){}.getType();
|
||||
}
|
||||
|
||||
return new TypeToken
|
||||
<Object>(){}.getType();
|
||||
return new TypeToken<Object>(){}.getType();
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -52,17 +52,11 @@ import java.io.File;
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -112,17 +106,11 @@ import java.io.File;
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -172,17 +160,11 @@ import java.io.File;
|
||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if (status != null)
|
||||
queryParams.put("status", ApiInvoker.parameterToString(status));
|
||||
@ -234,17 +216,11 @@ import java.io.File;
|
||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if (tags != null)
|
||||
queryParams.put("tags", ApiInvoker.parameterToString(tags));
|
||||
@ -301,17 +277,11 @@ import java.io.File;
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -368,17 +338,11 @@ import java.io.File;
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -444,17 +408,11 @@ import java.io.File;
|
||||
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -512,17 +470,11 @@ import java.io.File;
|
||||
String path = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
@ -51,17 +51,11 @@ import java.io.File;
|
||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -111,17 +105,11 @@ import java.io.File;
|
||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -176,17 +164,11 @@ import java.io.File;
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -241,17 +223,11 @@ import java.io.File;
|
||||
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
@ -52,17 +52,11 @@ import java.io.File;
|
||||
String path = "/user".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -112,17 +106,11 @@ import java.io.File;
|
||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -172,17 +160,11 @@ import java.io.File;
|
||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -233,17 +215,11 @@ import java.io.File;
|
||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if (username != null)
|
||||
queryParams.put("username", ApiInvoker.parameterToString(username));
|
||||
@ -296,17 +272,11 @@ import java.io.File;
|
||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -361,17 +331,11 @@ import java.io.File;
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -427,17 +391,11 @@ import java.io.File;
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -492,17 +450,11 @@ import java.io.File;
|
||||
String path = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
// header params
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
// form params
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
@ -48,4 +48,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,4 +109,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import io.swagger.client.model.Category;
|
||||
import io.swagger.client.model.Tag;
|
||||
import java.util.*;
|
||||
import io.swagger.client.model.Tag;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
@ -111,4 +111,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,4 +48,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,4 +133,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -500,7 +500,7 @@ namespace IO.Swagger.Api {
|
||||
|
||||
|
||||
// authentication setting, if any
|
||||
String[] authSettings = new String[] { "api_key", "petstore_auth" };
|
||||
String[] authSettings = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
@ -540,7 +540,7 @@ namespace IO.Swagger.Api {
|
||||
|
||||
|
||||
// authentication setting, if any
|
||||
String[] authSettings = new String[] { "api_key", "petstore_auth" };
|
||||
String[] authSettings = new String[] { "petstore_auth", "api_key" };
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
|
||||
|
@ -77,8 +77,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/main/java</source>
|
||||
<source>src/main/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -90,8 +89,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/test/java</source>
|
||||
<source>src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -102,8 +100,7 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>
|
||||
1.6</source>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -40,17 +40,12 @@ import io.swagger.client.auth.ApiKeyAuth;
|
||||
import io.swagger.client.auth.OAuth;
|
||||
|
||||
public class ApiClient {
|
||||
private Map
|
||||
<String, Client> hostMap = new HashMap
|
||||
<String, Client>();
|
||||
private Map
|
||||
<String, String> defaultHeaderMap = new HashMap
|
||||
<String, String>();
|
||||
private Map<String, Client> hostMap = new HashMap<String, Client>();
|
||||
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
|
||||
private boolean debugging = false;
|
||||
private String basePath = "http://petstore.swagger.io/v2";
|
||||
|
||||
private Map
|
||||
<String, Authentication> authentications;
|
||||
private Map<String, Authentication> authentications;
|
||||
|
||||
private DateFormat dateFormat;
|
||||
|
||||
@ -66,8 +61,7 @@ this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
setUserAgent("Java-Swagger");
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap
|
||||
<String, Authentication>();
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("petstore_auth", new OAuth());
|
||||
// Prevent the authentications from being modified.
|
||||
@ -86,8 +80,7 @@ return this;
|
||||
/**
|
||||
* Get authentications (key: authentication name, value: authentication).
|
||||
*/
|
||||
public Map
|
||||
<String, Authentication> getAuthentications() {
|
||||
public Map<String, Authentication> getAuthentications() {
|
||||
return authentications;
|
||||
}
|
||||
|
||||
@ -347,10 +340,7 @@ throw new ApiException(500, e.getMessage());
|
||||
* @param authNames The authentications to apply
|
||||
* @return The response body in type of string
|
||||
*/
|
||||
public String invokeAPI(String path, String method, Map
|
||||
<String, String> queryParams, Object body, Map
|
||||
<String, String> headerParams, Map
|
||||
<String, String> formParams, String accept, String contentType, String[] authNames) throws ApiException {
|
||||
public String invokeAPI(String path, String method, Map<String, String> queryParams, Object body, Map<String, String> headerParams, Map<String, String> formParams, String accept, String contentType, String[] authNames) throws ApiException {
|
||||
updateParamsForAuth(authNames, queryParams, headerParams);
|
||||
|
||||
Client client = getClient();
|
||||
@ -466,9 +456,7 @@ respBody);
|
||||
*
|
||||
* @param authNames The authentications to apply
|
||||
*/
|
||||
private void updateParamsForAuth(String[] authNames, Map
|
||||
<String, String> queryParams, Map
|
||||
<String, String> headerParams) {
|
||||
private void updateParamsForAuth(String[] authNames, Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
for (String authName : authNames) {
|
||||
Authentication auth = authentications.get(authName);
|
||||
if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
|
||||
@ -479,12 +467,10 @@ auth.applyToParams(queryParams, headerParams);
|
||||
/**
|
||||
* Encode the given form parameters as request body.
|
||||
*/
|
||||
private String getXWWWFormUrlencodedParams(Map
|
||||
<String, String> formParams) {
|
||||
private String getXWWWFormUrlencodedParams(Map<String, String> formParams) {
|
||||
StringBuilder formParamBuilder = new StringBuilder();
|
||||
|
||||
for (Entry
|
||||
<String, String> param : formParams.entrySet()) {
|
||||
for (Entry<String, String> param : formParams.entrySet()) {
|
||||
String keyStr = parameterToString(param.getKey());
|
||||
String valueStr = parameterToString(param.getValue());
|
||||
|
||||
|
@ -6,9 +6,7 @@ import java.util.List;
|
||||
public class ApiException extends Exception {
|
||||
private int code = 0;
|
||||
private String message = null;
|
||||
private Map
|
||||
<String, List
|
||||
<String>> responseHeaders = null;
|
||||
private Map<String, List<String>> responseHeaders = null;
|
||||
private String responseBody = null;
|
||||
|
||||
public ApiException() {}
|
||||
@ -18,10 +16,7 @@ private Map
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ApiException(int code, String message, Map
|
||||
<String
|
||||
, List
|
||||
<String>> responseHeaders, String responseBody) {
|
||||
public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.responseHeaders = responseHeaders;
|
||||
@ -39,10 +34,7 @@ private Map
|
||||
/**
|
||||
* Get the HTTP response headers.
|
||||
*/
|
||||
public Map
|
||||
<String
|
||||
, List
|
||||
<String>> getResponseHeaders() {
|
||||
public Map<String, List<String>> getResponseHeaders() {
|
||||
return responseHeaders;
|
||||
}
|
||||
|
||||
|
@ -54,15 +54,9 @@ import java.util.HashMap;
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -117,15 +111,9 @@ import java.util.HashMap;
|
||||
String path = "/pet".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -180,15 +168,9 @@ import java.util.HashMap;
|
||||
String path = "/pet/findByStatus".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if (status != null)
|
||||
queryParams.put("status", apiClient.parameterToString(status));
|
||||
@ -245,15 +227,9 @@ import java.util.HashMap;
|
||||
String path = "/pet/findByTags".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if (tags != null)
|
||||
queryParams.put("tags", apiClient.parameterToString(tags));
|
||||
@ -316,15 +292,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -352,7 +322,7 @@ import java.util.HashMap;
|
||||
}
|
||||
|
||||
try {
|
||||
String[] authNames = new String[] { "api_key", "petstore_auth" };
|
||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
||||
String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames);
|
||||
if(response != null){
|
||||
return (Pet) apiClient.deserialize(response, "", Pet.class);
|
||||
@ -387,15 +357,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -471,15 +435,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -544,15 +502,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
@ -53,15 +53,9 @@ import java.util.HashMap;
|
||||
String path = "/store/inventory".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -116,15 +110,9 @@ import java.util.HashMap;
|
||||
String path = "/store/order".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -185,15 +173,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -254,15 +236,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "orderId" + "\\}", apiClient.escapeString(orderId.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
@ -54,15 +54,9 @@ import java.util.HashMap;
|
||||
String path = "/user".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -117,15 +111,9 @@ import java.util.HashMap;
|
||||
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -180,15 +168,9 @@ import java.util.HashMap;
|
||||
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -244,15 +226,9 @@ import java.util.HashMap;
|
||||
String path = "/user/login".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
if (username != null)
|
||||
queryParams.put("username", apiClient.parameterToString(username));
|
||||
@ -310,15 +286,9 @@ import java.util.HashMap;
|
||||
String path = "/user/logout".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -379,15 +349,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -449,15 +413,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
@ -518,15 +476,9 @@ import java.util.HashMap;
|
||||
.replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString()));
|
||||
|
||||
// query params
|
||||
Map
|
||||
<String, String> queryParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> headerParams = new HashMap
|
||||
<String, String>();
|
||||
Map
|
||||
<String, String> formParams = new HashMap
|
||||
<String, String>();
|
||||
Map<String, String> queryParams = new HashMap<String, String>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> formParams = new HashMap<String, String>();
|
||||
|
||||
|
||||
|
||||
|
@ -39,9 +39,7 @@ this.apiKeyPrefix = apiKeyPrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(Map
|
||||
<String, String> queryParams, Map
|
||||
<String, String> headerParams) {
|
||||
public void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
String value;
|
||||
if (apiKeyPrefix != null) {
|
||||
value = apiKeyPrefix + " " + apiKey;
|
||||
|
@ -4,7 +4,5 @@ import java.util.Map;
|
||||
|
||||
public interface Authentication {
|
||||
/** Apply authentication settings to header and query params. */
|
||||
void applyToParams(Map
|
||||
<String, String> queryParams, Map
|
||||
<String, String> headerParams);
|
||||
void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams);
|
||||
}
|
||||
|
@ -26,9 +26,7 @@ this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(Map
|
||||
<String, String> queryParams, Map
|
||||
<String, String> headerParams) {
|
||||
public void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
|
||||
try {
|
||||
headerParams.put("Authorization", "Basic " + DatatypeConverter.printBase64Binary(str.getBytes("UTF-8")));
|
||||
|
@ -4,9 +4,7 @@ import java.util.Map;
|
||||
|
||||
public class OAuth implements Authentication {
|
||||
@Override
|
||||
public void applyToParams(Map
|
||||
<String, String> queryParams, Map
|
||||
<String, String> headerParams) {
|
||||
public void applyToParams(Map<String, String> queryParams, Map<String, String> headerParams) {
|
||||
// TODO: support oauth
|
||||
}
|
||||
}
|
||||
|
@ -48,4 +48,3 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,4 +109,3 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import io.swagger.client.model.Category;
|
||||
import io.swagger.client.model.Tag;
|
||||
import java.util.*;
|
||||
import io.swagger.client.model.Tag;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@ -111,4 +111,3 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,4 +48,3 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,4 +133,3 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
platform :ios, '6.0'
|
||||
xcodeproj 'PetstoreClient/PetstoreClient.xcodeproj'
|
||||
xcodeproj 'swaggerClient/swaggerClient.xcodeproj'
|
||||
pod 'AFNetworking', '~> 2.1'
|
||||
pod 'JSONModel', '~> 1.0'
|
||||
pod 'ISO8601'
|
||||
|
@ -1,21 +1,15 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGObject.h"
|
||||
|
||||
|
||||
|
||||
@protocol SWGCategory
|
||||
@end
|
||||
|
||||
@interface SWGCategory : SWGObject
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* name;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#import "SWGCategory.h"
|
||||
|
||||
@implementation SWGCategory
|
||||
@ -20,5 +19,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@ -1,5 +1,4 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface SWGConfiguration : NSObject
|
||||
|
||||
|
@ -1,34 +1,24 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGObject.h"
|
||||
|
||||
|
||||
|
||||
@protocol SWGOrder
|
||||
@end
|
||||
|
||||
@interface SWGOrder : SWGObject
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* petId;
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* quantity;
|
||||
|
||||
|
||||
@property(nonatomic) NSDate* shipDate;
|
||||
|
||||
/* Order Status [optional]
|
||||
*/
|
||||
@property(nonatomic) NSString* status;
|
||||
|
||||
|
||||
@property(nonatomic) BOOL complete;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#import "SWGOrder.h"
|
||||
|
||||
@implementation SWGOrder
|
||||
@ -20,5 +19,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@ -1,9 +1,7 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGObject.h"
|
||||
#import "SWGTag.h"
|
||||
#import "SWGCategory.h"
|
||||
|
||||
#import "SWGTag.h"
|
||||
|
||||
|
||||
@protocol SWGPet
|
||||
@ -12,25 +10,17 @@
|
||||
@interface SWGPet : SWGObject
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
|
||||
|
||||
@property(nonatomic) SWGCategory* category;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* name;
|
||||
|
||||
|
||||
@property(nonatomic) NSArray* photoUrls;
|
||||
|
||||
|
||||
@property(nonatomic) NSArray<SWGTag>* tags;
|
||||
|
||||
/* pet status in the store [optional]
|
||||
*/
|
||||
@property(nonatomic) NSString* status;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#import "SWGPet.h"
|
||||
|
||||
@implementation SWGPet
|
||||
@ -20,5 +19,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@ -1,5 +1,4 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGPet.h"
|
||||
#import "SWGFile.h"
|
||||
#import "SWGObject.h"
|
||||
@ -16,7 +15,6 @@
|
||||
+(SWGPetApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key;
|
||||
+(void) setBasePath:(NSString*)basePath;
|
||||
+(NSString*) getBasePath;
|
||||
|
||||
/**
|
||||
|
||||
Update an existing pet
|
||||
@ -33,7 +31,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Add a new pet to the store
|
||||
@ -50,7 +47,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by status
|
||||
@ -67,7 +63,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Finds Pets by tags
|
||||
@ -84,7 +79,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Find pet by ID
|
||||
@ -101,7 +95,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Updates a pet in the store with form data
|
||||
@ -122,7 +115,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Deletes a pet
|
||||
@ -141,7 +133,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
uploads an image
|
||||
@ -163,5 +154,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@ -5,7 +5,6 @@
|
||||
#import "SWGFile.h"
|
||||
|
||||
|
||||
|
||||
@interface SWGPetApi ()
|
||||
@property (readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders;
|
||||
@end
|
||||
@ -73,7 +72,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* Update an existing pet
|
||||
*
|
||||
@ -181,7 +179,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Add a new pet to the store
|
||||
*
|
||||
@ -289,7 +286,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
@ -384,6 +380,7 @@ return;
|
||||
completionBlock((NSArray<SWGPet>*)objs, nil);
|
||||
}
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
@ -393,7 +390,6 @@ return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Finds Pets by tags
|
||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||
@ -488,6 +484,7 @@ return;
|
||||
completionBlock((NSArray<SWGPet>*)objs, nil);
|
||||
}
|
||||
|
||||
|
||||
}];
|
||||
|
||||
|
||||
@ -497,7 +494,6 @@ return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Find pet by ID
|
||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
@ -548,7 +544,7 @@ return;
|
||||
NSString *requestContentType = [SWGApiClient selectHeaderContentType:@[]];
|
||||
|
||||
// Authentication setting
|
||||
NSArray *authSettings = @[@"api_key", @"petstore_auth"];
|
||||
NSArray *authSettings = @[@"petstore_auth", @"api_key"];
|
||||
|
||||
id bodyDictionary = nil;
|
||||
|
||||
@ -570,6 +566,7 @@ return;
|
||||
|
||||
|
||||
// complex response
|
||||
|
||||
// comples response type
|
||||
return [self.apiClient dictionary: requestUrl
|
||||
method: @"GET"
|
||||
@ -596,8 +593,8 @@ return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* Updates a pet in the store with form data
|
||||
@ -707,7 +704,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Deletes a pet
|
||||
*
|
||||
@ -800,7 +796,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* uploads an image
|
||||
*
|
||||
@ -918,7 +913,6 @@ completionBlock(nil);
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGOrder.h"
|
||||
#import "SWGObject.h"
|
||||
#import "SWGApiClient.h"
|
||||
@ -15,7 +14,6 @@
|
||||
+(SWGStoreApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key;
|
||||
+(void) setBasePath:(NSString*)basePath;
|
||||
+(NSString*) getBasePath;
|
||||
|
||||
/**
|
||||
|
||||
Returns pet inventories by status
|
||||
@ -30,7 +28,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Place an order for a pet
|
||||
@ -47,7 +44,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Find purchase order by ID
|
||||
@ -64,7 +60,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Delete purchase order by ID
|
||||
@ -82,5 +77,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@ -4,7 +4,6 @@
|
||||
#import "SWGOrder.h"
|
||||
|
||||
|
||||
|
||||
@interface SWGStoreApi ()
|
||||
@property (readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders;
|
||||
@end
|
||||
@ -72,7 +71,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
@ -146,11 +144,13 @@ if (error) {
|
||||
completionBlock(nil, error);
|
||||
return;
|
||||
}
|
||||
|
||||
NSDictionary *result = nil;
|
||||
if (data) {
|
||||
result = [[NSDictionary alloc]initWithDictionary: data];
|
||||
}
|
||||
completionBlock(data, nil);
|
||||
|
||||
}];
|
||||
|
||||
|
||||
@ -160,7 +160,6 @@ return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Place an order for a pet
|
||||
*
|
||||
@ -252,6 +251,7 @@ return;
|
||||
|
||||
|
||||
// complex response
|
||||
|
||||
// comples response type
|
||||
return [self.apiClient dictionary: requestUrl
|
||||
method: @"POST"
|
||||
@ -278,8 +278,8 @@ return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* Find purchase order by ID
|
||||
@ -353,6 +353,7 @@ return;
|
||||
|
||||
|
||||
// complex response
|
||||
|
||||
// comples response type
|
||||
return [self.apiClient dictionary: requestUrl
|
||||
method: @"GET"
|
||||
@ -379,8 +380,8 @@ return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* Delete purchase order by ID
|
||||
@ -472,7 +473,6 @@ completionBlock(nil);
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -1,21 +1,15 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGObject.h"
|
||||
|
||||
|
||||
|
||||
@protocol SWGTag
|
||||
@end
|
||||
|
||||
@interface SWGTag : SWGObject
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* name;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#import "SWGTag.h"
|
||||
|
||||
@implementation SWGTag
|
||||
@ -20,5 +19,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@ -1,40 +1,28 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGObject.h"
|
||||
|
||||
|
||||
|
||||
@protocol SWGUser
|
||||
@end
|
||||
|
||||
@interface SWGUser : SWGObject
|
||||
|
||||
|
||||
|
||||
@property(nonatomic) NSNumber* _id;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* username;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* firstName;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* lastName;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* email;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* password;
|
||||
|
||||
|
||||
@property(nonatomic) NSString* phone;
|
||||
|
||||
/* User Status [optional]
|
||||
*/
|
||||
@property(nonatomic) NSNumber* userStatus;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#import "SWGUser.h"
|
||||
|
||||
@implementation SWGUser
|
||||
@ -20,5 +19,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@ -1,5 +1,4 @@
|
||||
#import
|
||||
<Foundation/Foundation.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "SWGUser.h"
|
||||
#import "SWGObject.h"
|
||||
#import "SWGApiClient.h"
|
||||
@ -15,7 +14,6 @@
|
||||
+(SWGUserApi*) apiWithHeader:(NSString*)headerValue key:(NSString*)key;
|
||||
+(void) setBasePath:(NSString*)basePath;
|
||||
+(NSString*) getBasePath;
|
||||
|
||||
/**
|
||||
|
||||
Create user
|
||||
@ -32,7 +30,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
@ -49,7 +46,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Creates list of users with given input array
|
||||
@ -66,7 +62,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Logs user into the system
|
||||
@ -85,7 +80,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Logs out current logged in user session
|
||||
@ -100,7 +94,6 @@
|
||||
(void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Get user by user name
|
||||
@ -117,7 +110,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Updated user
|
||||
@ -136,7 +128,6 @@
|
||||
completionHandler: (void (^)(NSError* error))completionBlock;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Delete user
|
||||
@ -154,5 +145,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@ -4,7 +4,6 @@
|
||||
#import "SWGUser.h"
|
||||
|
||||
|
||||
|
||||
@interface SWGUserApi ()
|
||||
@property (readwrite, nonatomic, strong) NSMutableDictionary *defaultHeaders;
|
||||
@end
|
||||
@ -72,7 +71,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
@ -180,7 +178,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
@ -288,7 +285,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
@ -396,7 +392,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Logs user into the system
|
||||
*
|
||||
@ -494,13 +489,15 @@ completionBlock(result, nil);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// complex response
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* Logs out current logged in user session
|
||||
@ -584,7 +581,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Get user by user name
|
||||
*
|
||||
@ -657,6 +653,7 @@ completionBlock(nil);
|
||||
|
||||
|
||||
// complex response
|
||||
|
||||
// comples response type
|
||||
return [self.apiClient dictionary: requestUrl
|
||||
method: @"GET"
|
||||
@ -683,8 +680,8 @@ completionBlock(nil);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* Updated user
|
||||
@ -799,7 +796,6 @@ completionBlock(nil);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
@ -890,7 +886,6 @@ completionBlock(nil);
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -317,7 +317,7 @@ sub new {
|
||||
|
||||
|
||||
# authentication setting, if any
|
||||
my $auth_settings = ['api_key', 'petstore_auth'];
|
||||
my $auth_settings = ['petstore_auth', 'api_key'];
|
||||
|
||||
# make the API Call
|
||||
my $response = $self->{api_client}->call_api($_resource_path, $_method,
|
||||
|
@ -327,7 +327,7 @@ class PetApi {
|
||||
}
|
||||
|
||||
// authentication setting, if any
|
||||
$authSettings = array('api_key', 'petstore_auth');
|
||||
$authSettings = array('petstore_auth', 'api_key');
|
||||
|
||||
// make the API Call
|
||||
$response = $this->apiClient->callAPI($resourcePath, $method,
|
||||
|
@ -9,8 +9,8 @@ from .models.order import Order
|
||||
|
||||
# import apis into sdk package
|
||||
from .apis.user_api import UserApi
|
||||
from .apis.pet_api import PetApi
|
||||
from .apis.store_api import StoreApi
|
||||
from .apis.pet_api import PetApi
|
||||
|
||||
# import ApiClient
|
||||
from .api_client import ApiClient
|
||||
|
@ -2,6 +2,6 @@ from __future__ import absolute_import
|
||||
|
||||
# import apis into api package
|
||||
from .user_api import UserApi
|
||||
from .pet_api import PetApi
|
||||
from .store_api import StoreApi
|
||||
from .pet_api import PetApi
|
||||
|
||||
|
@ -298,7 +298,7 @@ class PetApi(object):
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type([])
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['api_key', 'petstore_auth']
|
||||
auth_settings = ['petstore_auth', 'api_key']
|
||||
|
||||
response = self.api_client.call_api(resource_path, method, path_params, query_params, header_params,
|
||||
body=body_params, post_params=form_params, files=files,
|
||||
|
@ -3,14 +3,10 @@
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QObject>
|
||||
#include
|
||||
<QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -85,7 +81,6 @@
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
SWGCategory::getId() {
|
||||
return id;
|
||||
@ -95,7 +90,6 @@
|
||||
this->id = id;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGCategory::getName() {
|
||||
return name;
|
||||
@ -107,6 +101,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
#ifndef SWGCategory_H_
|
||||
#define SWGCategory_H_
|
||||
|
||||
#include
|
||||
<QJsonObject>
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
@ -1,12 +1,9 @@
|
||||
#include "SWGHelpers.h"
|
||||
#include "SWGModelFactory.h"
|
||||
#include "SWGObject.h"
|
||||
#import
|
||||
<QDebug>
|
||||
#import
|
||||
<QJsonArray>
|
||||
#import
|
||||
<QJsonValue>
|
||||
#import <QDebug>
|
||||
#import <QJsonArray>
|
||||
#import <QJsonValue>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -17,27 +14,19 @@
|
||||
return;
|
||||
}
|
||||
if(QStringLiteral("bool").compare(type) == 0) {
|
||||
bool * val = static_cast
|
||||
<bool
|
||||
*>(value);
|
||||
bool * val = static_cast<bool*>(value);
|
||||
*val = obj.toBool();
|
||||
}
|
||||
else if(QStringLiteral("qint32").compare(type) == 0) {
|
||||
qint32 *val = static_cast
|
||||
<qint32
|
||||
*>(value);
|
||||
qint32 *val = static_cast<qint32*>(value);
|
||||
*val = obj.toInt();
|
||||
}
|
||||
else if(QStringLiteral("qint64").compare(type) == 0) {
|
||||
qint64 *val = static_cast
|
||||
<qint64
|
||||
*>(value);
|
||||
qint64 *val = static_cast<qint64*>(value);
|
||||
*val = obj.toVariant().toLongLong();
|
||||
}
|
||||
else if (QStringLiteral("QString").compare(type) == 0) {
|
||||
QString **val = static_cast
|
||||
<QString
|
||||
**>(value);
|
||||
QString **val = static_cast<QString**>(value);
|
||||
|
||||
if(val != NULL) {
|
||||
if(!obj.isNull()) {
|
||||
@ -62,20 +51,14 @@
|
||||
SWGObject * so = (SWGObject*)Swagger::create(type);
|
||||
if(so != NULL) {
|
||||
so->fromJsonObject(jsonObj);
|
||||
SWGObject **val = static_cast
|
||||
<SWGObject
|
||||
**>(value);
|
||||
SWGObject **val = static_cast<SWGObject**>(value);
|
||||
delete *val;
|
||||
*val = so;
|
||||
}
|
||||
}
|
||||
else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) {
|
||||
// list of values
|
||||
QList
|
||||
<void
|
||||
*>* output = new QList
|
||||
<void
|
||||
*>();
|
||||
QList<void*>* output = new QList<void*>();
|
||||
QJsonArray arr = obj.toArray();
|
||||
foreach (const QJsonValue & jval, arr) {
|
||||
if(complexType.startsWith("SWG")) {
|
||||
@ -105,12 +88,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
QList
|
||||
<void
|
||||
*> **val = static_cast
|
||||
<QList
|
||||
<void
|
||||
*>**>(value);
|
||||
QList<void*> **val = static_cast<QList<void*>**>(value);
|
||||
delete *val;
|
||||
*val = output;
|
||||
}
|
||||
@ -122,8 +100,7 @@
|
||||
return;
|
||||
}
|
||||
if(type.startsWith("SWG")) {
|
||||
SWGObject *swgObject = reinterpret_cast
|
||||
<SWGObject *>(value);
|
||||
SWGObject *swgObject = reinterpret_cast<SWGObject *>(value);
|
||||
if(swgObject != NULL) {
|
||||
QJsonObject* o = (*swgObject).asJsonObject();
|
||||
if(name != NULL) {
|
||||
@ -139,35 +116,25 @@
|
||||
}
|
||||
}
|
||||
else if(QStringLiteral("QString").compare(type) == 0) {
|
||||
QString* str = static_cast
|
||||
<QString
|
||||
*>(value);
|
||||
QString* str = static_cast<QString*>(value);
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("qint32").compare(type) == 0) {
|
||||
qint32* str = static_cast
|
||||
<qint32
|
||||
*>(value);
|
||||
qint32* str = static_cast<qint32*>(value);
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("qint64").compare(type) == 0) {
|
||||
qint64* str = static_cast
|
||||
<qint64
|
||||
*>(value);
|
||||
qint64* str = static_cast<qint64*>(value);
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
else if(QStringLiteral("bool").compare(type) == 0) {
|
||||
bool* str = static_cast
|
||||
<bool
|
||||
*>(value);
|
||||
bool* str = static_cast<bool*>(value);
|
||||
output->insert(name, QJsonValue(*str));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
toJsonArray(QList
|
||||
<void
|
||||
*>* value, QJsonArray* output, QString innerName, QString innerType) {
|
||||
toJsonArray(QList<void*>* value, QJsonArray* output, QString innerName, QString innerType) {
|
||||
foreach(void* obj, *value) {
|
||||
QJsonObject element;
|
||||
|
||||
@ -178,9 +145,7 @@
|
||||
|
||||
QString
|
||||
stringValue(QString* value) {
|
||||
QString* str = static_cast
|
||||
<QString
|
||||
*>(value);
|
||||
QString* str = static_cast<QString*>(value);
|
||||
return QString(*str);
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
#ifndef SWGHELPERS_H
|
||||
#define SWGHELPERS_H
|
||||
|
||||
#include
|
||||
<QJsonValue>
|
||||
#include <QJsonValue>
|
||||
|
||||
namespace Swagger {
|
||||
void setValue(void* value, QJsonValue obj, QString type, QString complexType);
|
||||
void toJsonArray(QList
|
||||
<void
|
||||
*>* value, QJsonArray* output, QString innerName, QString innerType);
|
||||
void toJsonArray(QList<void*>* value, QJsonArray* output, QString innerName, QString innerType);
|
||||
void toJsonValue(QString name, void* value, QJsonObject* output, QString type);
|
||||
bool isCompatibleJsonValue(QString type);
|
||||
QString stringValue(QString* value);
|
||||
|
@ -32,8 +32,7 @@ return NULL;
|
||||
inline void* create(QString json, QString type) {
|
||||
void* val = create(type);
|
||||
if(val != NULL) {
|
||||
SWGObject* obj = static_cast
|
||||
<SWGObject*>(val);
|
||||
SWGObject* obj = static_cast<SWGObject*>(val);
|
||||
return obj->fromJson(json);
|
||||
}
|
||||
if(type.startsWith("QString")) {
|
||||
|
@ -1,8 +1,7 @@
|
||||
#ifndef _SWG_OBJECT_H_
|
||||
#define _SWG_OBJECT_H_
|
||||
|
||||
#include
|
||||
<QJsonValue>
|
||||
#include <QJsonValue>
|
||||
|
||||
class SWGObject {
|
||||
public:
|
||||
|
@ -3,14 +3,10 @@
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QObject>
|
||||
#include
|
||||
<QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -108,7 +104,6 @@
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
SWGOrder::getId() {
|
||||
return id;
|
||||
@ -118,7 +113,6 @@
|
||||
this->id = id;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
SWGOrder::getPetId() {
|
||||
return petId;
|
||||
@ -128,7 +122,6 @@
|
||||
this->petId = petId;
|
||||
}
|
||||
|
||||
|
||||
qint32
|
||||
SWGOrder::getQuantity() {
|
||||
return quantity;
|
||||
@ -138,7 +131,6 @@
|
||||
this->quantity = quantity;
|
||||
}
|
||||
|
||||
|
||||
QDateTime*
|
||||
SWGOrder::getShipDate() {
|
||||
return shipDate;
|
||||
@ -148,7 +140,6 @@
|
||||
this->shipDate = shipDate;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGOrder::getStatus() {
|
||||
return status;
|
||||
@ -158,7 +149,6 @@
|
||||
this->status = status;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGOrder::getComplete() {
|
||||
return complete;
|
||||
@ -170,6 +160,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
#ifndef SWGOrder_H_
|
||||
#define SWGOrder_H_
|
||||
|
||||
#include
|
||||
<QJsonObject>
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "QDateTime.h"
|
||||
|
@ -3,14 +3,10 @@
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QObject>
|
||||
#include
|
||||
<QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -118,8 +114,7 @@
|
||||
|
||||
QList<QString*>* photoUrlsList = photoUrls;
|
||||
QJsonArray photoUrlsJsonArray;
|
||||
toJsonArray((QList
|
||||
<void*>*)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString");
|
||||
toJsonArray((QList<void*>*)photoUrls, &photoUrlsJsonArray, "photoUrls", "QString");
|
||||
|
||||
obj->insert("photoUrls", photoUrlsJsonArray);
|
||||
|
||||
@ -128,8 +123,7 @@
|
||||
|
||||
QList<SWGTag*>* tagsList = tags;
|
||||
QJsonArray tagsJsonArray;
|
||||
toJsonArray((QList
|
||||
<void*>*)tags, &tagsJsonArray, "tags", "SWGTag");
|
||||
toJsonArray((QList<void*>*)tags, &tagsJsonArray, "tags", "SWGTag");
|
||||
|
||||
obj->insert("tags", tagsJsonArray);
|
||||
|
||||
@ -145,7 +139,6 @@
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
SWGPet::getId() {
|
||||
return id;
|
||||
@ -155,7 +148,6 @@
|
||||
this->id = id;
|
||||
}
|
||||
|
||||
|
||||
SWGCategory*
|
||||
SWGPet::getCategory() {
|
||||
return category;
|
||||
@ -165,7 +157,6 @@
|
||||
this->category = category;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGPet::getName() {
|
||||
return name;
|
||||
@ -175,7 +166,6 @@
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
|
||||
QList<QString*>*
|
||||
SWGPet::getPhotoUrls() {
|
||||
return photoUrls;
|
||||
@ -185,7 +175,6 @@
|
||||
this->photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
QList<SWGTag*>*
|
||||
SWGPet::getTags() {
|
||||
return tags;
|
||||
@ -195,7 +184,6 @@
|
||||
this->tags = tags;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGPet::getStatus() {
|
||||
return status;
|
||||
@ -207,6 +195,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,14 +7,13 @@
|
||||
#ifndef SWGPet_H_
|
||||
#define SWGPet_H_
|
||||
|
||||
#include
|
||||
<QJsonObject>
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGTag.h"
|
||||
#include <QList>
|
||||
#include "SWGCategory.h"
|
||||
#include <QString>
|
||||
#include "SWGCategory.h"
|
||||
#include <QList>
|
||||
#include "SWGTag.h"
|
||||
|
||||
#include "SWGObject.h"
|
||||
|
||||
|
@ -2,10 +2,8 @@
|
||||
#include "SWGHelpers.h"
|
||||
#include "SWGModelFactory.h"
|
||||
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace Swagger {
|
||||
SWGPetApi::SWGPetApi() {}
|
||||
@ -17,8 +15,6 @@
|
||||
this->basePath = basePath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
SWGPetApi::updatePet(SWGPet body) {
|
||||
QString fullPath;
|
||||
@ -67,7 +63,6 @@
|
||||
|
||||
emit updatePetSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGPetApi::addPet(SWGPet body) {
|
||||
QString fullPath;
|
||||
@ -116,7 +111,6 @@
|
||||
|
||||
emit addPetSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGPetApi::findPetsByStatus(QList<QString*>* status) {
|
||||
QString fullPath;
|
||||
@ -222,7 +216,6 @@
|
||||
emit findPetsByStatusSignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGPetApi::findPetsByTags(QList<QString*>* tags) {
|
||||
QString fullPath;
|
||||
@ -328,7 +321,6 @@
|
||||
emit findPetsByTagsSignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGPetApi::getPetById(qint64 petId) {
|
||||
QString fullPath;
|
||||
@ -374,8 +366,7 @@
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
SWGPet* output = static_cast<SWGPet*>(create(json,
|
||||
QString("SWGPet")));
|
||||
SWGPet* output = static_cast<SWGPet*>(create(json, QString("SWGPet")));
|
||||
|
||||
|
||||
|
||||
@ -385,11 +376,8 @@
|
||||
emit getPetByIdSignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGPetApi::updatePetWithForm(QString* petId
|
||||
, QString* name
|
||||
, QString* status) {
|
||||
SWGPetApi::updatePetWithForm(QString* petId, QString* name, QString* status) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
|
||||
@ -442,10 +430,8 @@
|
||||
|
||||
emit updatePetWithFormSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGPetApi::deletePet(QString* apiKey
|
||||
, qint64 petId) {
|
||||
SWGPetApi::deletePet(QString* apiKey, qint64 petId) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}");
|
||||
|
||||
@ -492,11 +478,8 @@
|
||||
|
||||
emit deletePetSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGPetApi::uploadFile(qint64 petId
|
||||
, QString* additionalMetadata
|
||||
, SWGHttpRequestInputFileElement* file) {
|
||||
SWGPetApi::uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/pet/{petId}/uploadImage");
|
||||
|
||||
@ -545,6 +528,4 @@
|
||||
|
||||
emit uploadFileSignal();
|
||||
}
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -7,8 +7,7 @@
|
||||
#include <QString>
|
||||
#include "SWGHttpRequest.h"
|
||||
|
||||
#include
|
||||
<QObject>
|
||||
#include <QObject>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -28,14 +27,9 @@
|
||||
void findPetsByStatus(QList<QString*>* status);
|
||||
void findPetsByTags(QList<QString*>* tags);
|
||||
void getPetById(qint64 petId);
|
||||
void updatePetWithForm(QString* petId
|
||||
, QString* name
|
||||
, QString* status);
|
||||
void deletePet(QString* apiKey
|
||||
, qint64 petId);
|
||||
void uploadFile(qint64 petId
|
||||
, QString* additionalMetadata
|
||||
, SWGHttpRequestInputFileElement* file);
|
||||
void updatePetWithForm(QString* petId, QString* name, QString* status);
|
||||
void deletePet(QString* apiKey, qint64 petId);
|
||||
void uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestInputFileElement* file);
|
||||
|
||||
private:
|
||||
void updatePetCallback (HttpRequestWorker * worker);
|
||||
|
@ -2,10 +2,8 @@
|
||||
#include "SWGHelpers.h"
|
||||
#include "SWGModelFactory.h"
|
||||
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace Swagger {
|
||||
SWGStoreApi::SWGStoreApi() {}
|
||||
@ -17,8 +15,6 @@
|
||||
this->basePath = basePath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
SWGStoreApi::getInventory() {
|
||||
QString fullPath;
|
||||
@ -82,7 +78,6 @@
|
||||
emit getInventorySignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGStoreApi::placeOrder(SWGOrder body) {
|
||||
QString fullPath;
|
||||
@ -130,8 +125,7 @@
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
SWGOrder* output = static_cast<SWGOrder*>(create(json,
|
||||
QString("SWGOrder")));
|
||||
SWGOrder* output = static_cast<SWGOrder*>(create(json, QString("SWGOrder")));
|
||||
|
||||
|
||||
|
||||
@ -141,7 +135,6 @@
|
||||
emit placeOrderSignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGStoreApi::getOrderById(QString* orderId) {
|
||||
QString fullPath;
|
||||
@ -187,8 +180,7 @@
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
SWGOrder* output = static_cast<SWGOrder*>(create(json,
|
||||
QString("SWGOrder")));
|
||||
SWGOrder* output = static_cast<SWGOrder*>(create(json, QString("SWGOrder")));
|
||||
|
||||
|
||||
|
||||
@ -198,7 +190,6 @@
|
||||
emit getOrderByIdSignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGStoreApi::deleteOrder(QString* orderId) {
|
||||
QString fullPath;
|
||||
@ -245,6 +236,4 @@
|
||||
|
||||
emit deleteOrderSignal();
|
||||
}
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -7,8 +7,7 @@
|
||||
#include "SWGOrder.h"
|
||||
#include <QString>
|
||||
|
||||
#include
|
||||
<QObject>
|
||||
#include <QObject>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
|
@ -3,14 +3,10 @@
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QObject>
|
||||
#include
|
||||
<QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -85,7 +81,6 @@
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
SWGTag::getId() {
|
||||
return id;
|
||||
@ -95,7 +90,6 @@
|
||||
this->id = id;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGTag::getName() {
|
||||
return name;
|
||||
@ -107,6 +101,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
#ifndef SWGTag_H_
|
||||
#define SWGTag_H_
|
||||
|
||||
#include
|
||||
<QJsonObject>
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
@ -3,14 +3,10 @@
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QObject>
|
||||
#include
|
||||
<QDebug>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -144,7 +140,6 @@
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
qint64
|
||||
SWGUser::getId() {
|
||||
return id;
|
||||
@ -154,7 +149,6 @@
|
||||
this->id = id;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGUser::getUsername() {
|
||||
return username;
|
||||
@ -164,7 +158,6 @@
|
||||
this->username = username;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGUser::getFirstName() {
|
||||
return firstName;
|
||||
@ -174,7 +167,6 @@
|
||||
this->firstName = firstName;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGUser::getLastName() {
|
||||
return lastName;
|
||||
@ -184,7 +176,6 @@
|
||||
this->lastName = lastName;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGUser::getEmail() {
|
||||
return email;
|
||||
@ -194,7 +185,6 @@
|
||||
this->email = email;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGUser::getPassword() {
|
||||
return password;
|
||||
@ -204,7 +194,6 @@
|
||||
this->password = password;
|
||||
}
|
||||
|
||||
|
||||
QString*
|
||||
SWGUser::getPhone() {
|
||||
return phone;
|
||||
@ -214,7 +203,6 @@
|
||||
this->phone = phone;
|
||||
}
|
||||
|
||||
|
||||
qint32
|
||||
SWGUser::getUserStatus() {
|
||||
return userStatus;
|
||||
@ -226,6 +214,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
#ifndef SWGUser_H_
|
||||
#define SWGUser_H_
|
||||
|
||||
#include
|
||||
<QJsonObject>
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
@ -2,10 +2,8 @@
|
||||
#include "SWGHelpers.h"
|
||||
#include "SWGModelFactory.h"
|
||||
|
||||
#include
|
||||
<QJsonArray>
|
||||
#include
|
||||
<QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace Swagger {
|
||||
SWGUserApi::SWGUserApi() {}
|
||||
@ -17,8 +15,6 @@
|
||||
this->basePath = basePath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
SWGUserApi::createUser(SWGUser body) {
|
||||
QString fullPath;
|
||||
@ -67,7 +63,6 @@
|
||||
|
||||
emit createUserSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::createUsersWithArrayInput(QList<SWGUser*>* body) {
|
||||
QString fullPath;
|
||||
@ -85,9 +80,7 @@
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList
|
||||
<void
|
||||
*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
|
||||
QJsonDocument doc(*bodyArray);
|
||||
QByteArray bytes = doc.toJson();
|
||||
@ -123,7 +116,6 @@
|
||||
|
||||
emit createUsersWithArrayInputSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::createUsersWithListInput(QList<SWGUser*>* body) {
|
||||
QString fullPath;
|
||||
@ -141,9 +133,7 @@
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList
|
||||
<void
|
||||
*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
|
||||
QJsonDocument doc(*bodyArray);
|
||||
QByteArray bytes = doc.toJson();
|
||||
@ -179,10 +169,8 @@
|
||||
|
||||
emit createUsersWithListInputSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::loginUser(QString* username
|
||||
, QString* password) {
|
||||
SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/login");
|
||||
|
||||
@ -247,8 +235,7 @@
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
QString* output = static_cast<QString*>(create(json,
|
||||
QString("QString")));
|
||||
QString* output = static_cast<QString*>(create(json, QString("QString")));
|
||||
|
||||
|
||||
|
||||
@ -258,7 +245,6 @@
|
||||
emit loginUserSignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::logoutUser() {
|
||||
QString fullPath;
|
||||
@ -302,7 +288,6 @@
|
||||
|
||||
emit logoutUserSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::getUserByName(QString* username) {
|
||||
QString fullPath;
|
||||
@ -348,8 +333,7 @@
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
SWGUser* output = static_cast<SWGUser*>(create(json,
|
||||
QString("SWGUser")));
|
||||
SWGUser* output = static_cast<SWGUser*>(create(json, QString("SWGUser")));
|
||||
|
||||
|
||||
|
||||
@ -359,10 +343,8 @@
|
||||
emit getUserByNameSignal(output);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::updateUser(QString* username
|
||||
, SWGUser body) {
|
||||
SWGUserApi::updateUser(QString* username, SWGUser body) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||
|
||||
@ -412,7 +394,6 @@
|
||||
|
||||
emit updateUserSignal();
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::deleteUser(QString* username) {
|
||||
QString fullPath;
|
||||
@ -459,6 +440,4 @@
|
||||
|
||||
emit deleteUserSignal();
|
||||
}
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
@ -7,8 +7,7 @@
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#include
|
||||
<QObject>
|
||||
#include <QObject>
|
||||
|
||||
namespace Swagger {
|
||||
|
||||
@ -26,12 +25,10 @@
|
||||
void createUser(SWGUser body);
|
||||
void createUsersWithArrayInput(QList<SWGUser*>* body);
|
||||
void createUsersWithListInput(QList<SWGUser*>* body);
|
||||
void loginUser(QString* username
|
||||
, QString* password);
|
||||
void loginUser(QString* username, QString* password);
|
||||
void logoutUser();
|
||||
void getUserByName(QString* username);
|
||||
void updateUser(QString* username
|
||||
, SWGUser body);
|
||||
void updateUser(QString* username, SWGUser body);
|
||||
void deleteUser(QString* username);
|
||||
|
||||
private:
|
||||
|
@ -77,8 +77,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/main/java</source>
|
||||
<source>src/main/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -90,8 +89,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/test/java</source>
|
||||
<source>src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -102,8 +100,7 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>
|
||||
1.6</source>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -47,4 +47,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,4 +108,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import io.swagger.client.model.Category;
|
||||
import io.swagger.client.model.Tag;
|
||||
import java.util.*;
|
||||
import io.swagger.client.model.Tag;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
@ -110,4 +110,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,4 +47,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,4 +132,3 @@ import com.google.gson.annotations.SerializedName;
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,8 @@ require 'swagger_client/models/order'
|
||||
|
||||
# APIs
|
||||
require 'swagger_client/api/user_api'
|
||||
require 'swagger_client/api/pet_api'
|
||||
require 'swagger_client/api/store_api'
|
||||
require 'swagger_client/api/pet_api'
|
||||
|
||||
module SwaggerClient
|
||||
# Initialize the default configuration
|
||||
|
@ -190,7 +190,7 @@ module SwaggerClient
|
||||
post_body = nil
|
||||
|
||||
|
||||
auth_names = ['api_key', 'petstore_auth']
|
||||
auth_names = ['petstore_auth', 'api_key']
|
||||
response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
||||
obj = Pet.new() and obj.build_from_hash(response)
|
||||
end
|
||||
|
@ -81,8 +81,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/main/java</source>
|
||||
<source>src/main/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -94,8 +93,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>
|
||||
src/test/java</source>
|
||||
<source>src/test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -106,8 +104,7 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>
|
||||
1.6</source>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -3,9 +3,7 @@ package io.swagger.client.model
|
||||
|
||||
|
||||
|
||||
|
||||
case class Category (
|
||||
id: Long,
|
||||
name: String)
|
||||
|
||||
|
||||
|
@ -4,7 +4,6 @@ import org.joda.time.DateTime
|
||||
|
||||
|
||||
|
||||
|
||||
case class Order (
|
||||
id: Long,
|
||||
petId: Long,
|
||||
@ -14,4 +13,3 @@ import org.joda.time.DateTime
|
||||
status: String,
|
||||
complete: Boolean)
|
||||
|
||||
|
||||
|
@ -5,7 +5,6 @@ import io.swagger.client.model.Tag
|
||||
|
||||
|
||||
|
||||
|
||||
case class Pet (
|
||||
id: Long,
|
||||
category: Category,
|
||||
@ -15,4 +14,3 @@ import io.swagger.client.model.Tag
|
||||
/* pet status in the store */
|
||||
status: String)
|
||||
|
||||
|
||||
|
@ -3,9 +3,7 @@ package io.swagger.client.model
|
||||
|
||||
|
||||
|
||||
|
||||
case class Tag (
|
||||
id: Long,
|
||||
name: String)
|
||||
|
||||
|
||||
|
@ -3,7 +3,6 @@ package io.swagger.client.model
|
||||
|
||||
|
||||
|
||||
|
||||
case class User (
|
||||
id: Long,
|
||||
username: String,
|
||||
@ -15,4 +14,3 @@ package io.swagger.client.model
|
||||
/* User Status */
|
||||
userStatus: Integer)
|
||||
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include
|
||||
<FNet.h>
|
||||
#include <FNet.h>
|
||||
|
||||
#include "SamiHelpers.h"
|
||||
#include "SamiError.h"
|
||||
@ -20,8 +19,7 @@
|
||||
virtual ~SamiApiClient();
|
||||
|
||||
result
|
||||
execute(String host, String path, String method, IMap* queryParams, String* body, IMap* headerParams, IMap*
|
||||
formParams, String contentType);
|
||||
execute(String host, String path, String method, IMap* queryParams, String* body, IMap* headerParams, IMap* formParams, String contentType);
|
||||
|
||||
void success(void (*res) (HttpResponse*, void (*cb)(void*, SamiError*)), void (*cb)(void*, SamiError*));
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
#include "SamiCategory.h"
|
||||
#include
|
||||
<FLocales.h>
|
||||
#include <FLocales.h>
|
||||
|
||||
using namespace Tizen::Base;
|
||||
using namespace Tizen::System;
|
||||
@ -159,7 +158,6 @@
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
||||
Long*
|
||||
SamiCategory::getPId() {
|
||||
return pId;
|
||||
@ -169,7 +167,6 @@
|
||||
this->pId = pId;
|
||||
}
|
||||
|
||||
|
||||
String*
|
||||
SamiCategory::getPName() {
|
||||
return pName;
|
||||
@ -181,6 +178,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,14 +7,10 @@
|
||||
#ifndef SamiCategory_H_
|
||||
#define SamiCategory_H_
|
||||
|
||||
#include
|
||||
<FApp.h>
|
||||
#include
|
||||
<FBase.h>
|
||||
#include
|
||||
<FSystem.h>
|
||||
#include
|
||||
<FWebJson.h>
|
||||
#include <FApp.h>
|
||||
#include <FBase.h>
|
||||
#include <FSystem.h>
|
||||
#include <FWebJson.h>
|
||||
#include "SamiHelpers.h"
|
||||
#include "SamiObject.h"
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
#ifndef SamiError_H_
|
||||
#define SamiError_H_
|
||||
|
||||
#include
|
||||
<FBase.h>
|
||||
#include <FBase.h>
|
||||
|
||||
using namespace Tizen::Base;
|
||||
|
||||
|
@ -1,16 +1,11 @@
|
||||
#ifndef HELPERS_H_
|
||||
#define HELPERS_H_
|
||||
|
||||
#include
|
||||
<FApp.h>
|
||||
#include
|
||||
<FBase.h>
|
||||
#include
|
||||
<FSystem.h>
|
||||
#include
|
||||
<FWebJson.h>
|
||||
#include
|
||||
<FLocales.h>
|
||||
#include <FApp.h>
|
||||
#include <FBase.h>
|
||||
#include <FSystem.h>
|
||||
#include <FWebJson.h>
|
||||
#include <FLocales.h>
|
||||
#include "SamiHelpers.h"
|
||||
#include "SamiObject.h"
|
||||
|
||||
|
@ -1,12 +1,9 @@
|
||||
#ifndef _Sami_OBJECT_H_
|
||||
#define _Sami_OBJECT_H_
|
||||
|
||||
#include
|
||||
<FNet.h>
|
||||
#include
|
||||
<FWebJson.h>
|
||||
#include
|
||||
<FBase.h>
|
||||
#include <FNet.h>
|
||||
#include <FWebJson.h>
|
||||
#include <FBase.h>
|
||||
|
||||
using Tizen::Base::String;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
#include "SamiOrder.h"
|
||||
#include
|
||||
<FLocales.h>
|
||||
#include <FLocales.h>
|
||||
|
||||
using namespace Tizen::Base;
|
||||
using namespace Tizen::System;
|
||||
@ -235,7 +234,6 @@
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
||||
Long*
|
||||
SamiOrder::getPId() {
|
||||
return pId;
|
||||
@ -245,7 +243,6 @@
|
||||
this->pId = pId;
|
||||
}
|
||||
|
||||
|
||||
Long*
|
||||
SamiOrder::getPPetId() {
|
||||
return pPetId;
|
||||
@ -255,7 +252,6 @@
|
||||
this->pPetId = pPetId;
|
||||
}
|
||||
|
||||
|
||||
Integer*
|
||||
SamiOrder::getPQuantity() {
|
||||
return pQuantity;
|
||||
@ -265,7 +261,6 @@
|
||||
this->pQuantity = pQuantity;
|
||||
}
|
||||
|
||||
|
||||
DateTime*
|
||||
SamiOrder::getPShipDate() {
|
||||
return pShipDate;
|
||||
@ -275,7 +270,6 @@
|
||||
this->pShipDate = pShipDate;
|
||||
}
|
||||
|
||||
|
||||
String*
|
||||
SamiOrder::getPStatus() {
|
||||
return pStatus;
|
||||
@ -285,7 +279,6 @@
|
||||
this->pStatus = pStatus;
|
||||
}
|
||||
|
||||
|
||||
Boolean*
|
||||
SamiOrder::getPComplete() {
|
||||
return pComplete;
|
||||
@ -297,6 +290,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,25 +7,21 @@
|
||||
#ifndef SamiOrder_H_
|
||||
#define SamiOrder_H_
|
||||
|
||||
#include
|
||||
<FApp.h>
|
||||
#include
|
||||
<FBase.h>
|
||||
#include
|
||||
<FSystem.h>
|
||||
#include
|
||||
<FWebJson.h>
|
||||
#include <FApp.h>
|
||||
#include <FBase.h>
|
||||
#include <FSystem.h>
|
||||
#include <FWebJson.h>
|
||||
#include "SamiHelpers.h"
|
||||
#include "SamiObject.h"
|
||||
|
||||
using namespace Tizen::Web::Json;
|
||||
|
||||
|
||||
using Tizen::Base::Integer;
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::DateTime;
|
||||
using Tizen::Base::String;
|
||||
using Tizen::Base::Boolean;
|
||||
using Tizen::Base::Integer;
|
||||
using Tizen::Base::DateTime;
|
||||
|
||||
|
||||
namespace Swagger {
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
#include "SamiPet.h"
|
||||
#include
|
||||
<FLocales.h>
|
||||
#include <FLocales.h>
|
||||
|
||||
using namespace Tizen::Base;
|
||||
using namespace Tizen::System;
|
||||
@ -235,7 +234,6 @@
|
||||
return pJsonObject;
|
||||
}
|
||||
|
||||
|
||||
Long*
|
||||
SamiPet::getPId() {
|
||||
return pId;
|
||||
@ -245,7 +243,6 @@
|
||||
this->pId = pId;
|
||||
}
|
||||
|
||||
|
||||
SamiCategory*
|
||||
SamiPet::getPCategory() {
|
||||
return pCategory;
|
||||
@ -255,7 +252,6 @@
|
||||
this->pCategory = pCategory;
|
||||
}
|
||||
|
||||
|
||||
String*
|
||||
SamiPet::getPName() {
|
||||
return pName;
|
||||
@ -265,7 +261,6 @@
|
||||
this->pName = pName;
|
||||
}
|
||||
|
||||
|
||||
IList*
|
||||
SamiPet::getPPhotoUrls() {
|
||||
return pPhotoUrls;
|
||||
@ -275,7 +270,6 @@
|
||||
this->pPhotoUrls = pPhotoUrls;
|
||||
}
|
||||
|
||||
|
||||
IList*
|
||||
SamiPet::getPTags() {
|
||||
return pTags;
|
||||
@ -285,7 +279,6 @@
|
||||
this->pTags = pTags;
|
||||
}
|
||||
|
||||
|
||||
String*
|
||||
SamiPet::getPStatus() {
|
||||
return pStatus;
|
||||
@ -297,6 +290,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
||||
|
@ -7,23 +7,19 @@
|
||||
#ifndef SamiPet_H_
|
||||
#define SamiPet_H_
|
||||
|
||||
#include
|
||||
<FApp.h>
|
||||
#include
|
||||
<FBase.h>
|
||||
#include
|
||||
<FSystem.h>
|
||||
#include
|
||||
<FWebJson.h>
|
||||
#include <FApp.h>
|
||||
#include <FBase.h>
|
||||
#include <FSystem.h>
|
||||
#include <FWebJson.h>
|
||||
#include "SamiHelpers.h"
|
||||
#include "SamiObject.h"
|
||||
|
||||
using namespace Tizen::Web::Json;
|
||||
|
||||
|
||||
#include "SamiCategory.h"
|
||||
using Tizen::Base::Long;
|
||||
using Tizen::Base::String;
|
||||
#include "SamiCategory.h"
|
||||
#include "SamiTag.h"
|
||||
using Tizen::Base::Collection::IList;
|
||||
|
||||
|
@ -16,7 +16,6 @@ namespace Swagger {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
updatePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -66,7 +65,6 @@ namespace Swagger {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
addPetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -116,7 +114,6 @@ namespace Swagger {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
findPetsByStatusProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -186,7 +183,6 @@ namespace Swagger {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
findPetsByTagsProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -256,7 +252,6 @@ namespace Swagger {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
getPetByIdProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -324,7 +319,6 @@ namespace Swagger {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
updatePetWithFormProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -371,7 +365,6 @@ namespace Swagger {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
deletePetProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -421,7 +414,6 @@ namespace Swagger {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
uploadFileProcessor(HttpResponse* pHttpResponse, void (* handler)(void*, SamiError*)) {
|
||||
int code = pHttpResponse->GetHttpStatusCode();
|
||||
@ -469,5 +461,4 @@ namespace Swagger {
|
||||
}
|
||||
|
||||
|
||||
|
||||
} /* namespace Swagger */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user