Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions samples/client/petstore/android-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,55 +104,8 @@
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala-maven-plugin-version}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<configuration>
<recompileMode>incremental</recompileMode>
</configuration>
<jvmArgs>
<jvmArg>-Xmx384m</jvmArg>
</jvmArgs>
<args>
<arg>-target:jvm-1.5</arg>
<arg>-deprecation</arg>
</args>
<launchers>
<launcher>
<id>run-scalatest</id>
<mainClass>org.scalatest.tools.Runner</mainClass>
<args>
<arg>-p</arg>
<arg>${project.build.testOutputDirectory}</arg>
</args>
<jvmArgs>
<jvmArg>-Xmx512m</jvmArg>
</jvmArgs>
</launcher>
</launchers>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala-maven-plugin-version}</version>
</plugin>
</plugins>
</reporting>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -180,18 +133,6 @@
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.9.1</artifactId>
<version>${scala-test-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -202,13 +143,10 @@

<properties>
<jackson-version>2.1.4</jackson-version>
<scala-version>2.9.1-1</scala-version>
<junit-version>4.8.1</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.8.1</junit-version>
<scala-test-version>1.6.1</scala-test-version>
<httpclient-version>4.0</httpclient-version>
<scala-maven-plugin-version>3.1.5</scala-maven-plugin-version>
</properties>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public Pet getPetById (Long petId) throws ApiException {
}
}
}
//error info- code: 400 reason: "Invalid pet value" model: <none>
public void deletePet (String petId) throws ApiException {
//error info- code: 405 reason: "Invalid input" model: <none>
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
// verify required params are set
if(petId == null ) {
throw new ApiException(400, "missing required params");
Expand All @@ -75,7 +75,7 @@ public void deletePet (String petId) throws ApiException {
String contentType = "application/json";

try {
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, contentType);
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, contentType);
if(response != null){
return ;
}
Expand All @@ -91,40 +91,8 @@ public void deletePet (String petId) throws ApiException {
}
}
}
//error info- code: 400 reason: "Invalid tag value" model: <none>
public List<Pet> partialUpdate (String petId, Pet body) throws ApiException {
// verify required params are set
if(petId == null || body == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
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> headerParams = new HashMap<String, String>();

String contentType = "application/json";

try {
String response = apiInvoker.invokeAPI(basePath, path, "PATCH", queryParams, body, headerParams, contentType);
if(response != null){
return (List<Pet>) ApiInvoker.deserialize(response, "Array", Pet.class);
}
else {
return null;
}
} catch (ApiException ex) {
if(ex.getCode() == 404) {
return null;
}
else {
throw ex;
}
}
}
//error info- code: 405 reason: "Invalid input" model: <none>
public void updatePetWithForm (String petId, String name, String status) throws ApiException {
//error info- code: 400 reason: "Invalid pet value" model: <none>
public void deletePet (String petId) throws ApiException {
// verify required params are set
if(petId == null ) {
throw new ApiException(400, "missing required params");
Expand All @@ -139,7 +107,7 @@ public void updatePetWithForm (String petId, String name, String status) throws
String contentType = "application/json";

try {
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, contentType);
String response = apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, null, headerParams, contentType);
if(response != null){
return ;
}
Expand All @@ -155,9 +123,14 @@ public void updatePetWithForm (String petId, String name, String status) throws
}
}
}
public void uploadFile (String additionalMetadata, File body) throws ApiException {
//error info- code: 400 reason: "Invalid tag value" model: <none>
public List<Pet> partialUpdate (String petId, Pet body) throws ApiException {
// verify required params are set
if(petId == null || body == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
String path = "/pet/uploadImage".replaceAll("\\{format\\}","json");
String path = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));

// query params
Map<String, String> queryParams = new HashMap<String, String>();
Expand All @@ -166,16 +139,16 @@ public void uploadFile (String additionalMetadata, File body) throws ApiExceptio
String contentType = "application/json";

try {
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, contentType);
String response = apiInvoker.invokeAPI(basePath, path, "PATCH", queryParams, body, headerParams, contentType);
if(response != null){
return ;
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
}
else {
return ;
return null;
}
} catch (ApiException ex) {
if(ex.getCode() == 404) {
return ;
return null;
}
else {
throw ex;
Expand Down Expand Up @@ -268,7 +241,7 @@ public List<Pet> findPetsByStatus (String status) throws ApiException {
try {
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
if(response != null){
return (List<Pet>) ApiInvoker.deserialize(response, "Array", Pet.class);
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
}
else {
return null;
Expand Down Expand Up @@ -302,7 +275,7 @@ public List<Pet> findPetsByTags (String tags) throws ApiException {
try {
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
if(response != null){
return (List<Pet>) ApiInvoker.deserialize(response, "Array", Pet.class);
return (List<Pet>) ApiInvoker.deserialize(response, "List", Pet.class);
}
else {
return null;
Expand All @@ -316,5 +289,32 @@ public List<Pet> findPetsByTags (String tags) throws ApiException {
}
}
}
public void uploadFile (String additionalMetadata, File file) throws ApiException {
// create path and map variables
String path = "/pet/uploadImage".replaceAll("\\{format\\}","json");

// query params
Map<String, String> queryParams = new HashMap<String, String>();
Map<String, String> headerParams = new HashMap<String, String>();

String contentType = "application/json";

try {
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, null, headerParams, contentType);
if(response != null){
return ;
}
else {
return ;
}
} catch (ApiException ex) {
if(ex.getCode() == 404) {
return ;
}
else {
throw ex;
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ public String getBasePath() {
return basePath;
}

//error info- code: 400 reason: "Invalid ID supplied" model: <none>
//error info- code: 404 reason: "Order not found" model: <none>
public Order getOrderById (String orderId) throws ApiException {
//error info- code: 400 reason: "Invalid order" model: <none>
public void placeOrder (Order body) throws ApiException {
// verify required params are set
if(orderId == null ) {
if(body == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));
String path = "/store/order".replaceAll("\\{format\\}","json");

// query params
Map<String, String> queryParams = new HashMap<String, String>();
Expand All @@ -43,16 +42,16 @@ public Order getOrderById (String orderId) throws ApiException {
String contentType = "application/json";

try {
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, contentType);
if(response != null){
return (Order) ApiInvoker.deserialize(response, "", Order.class);
return ;
}
else {
return null;
return ;
}
} catch (ApiException ex) {
if(ex.getCode() == 404) {
return null;
return ;
}
else {
throw ex;
Expand Down Expand Up @@ -92,14 +91,15 @@ public void deleteOrder (String orderId) throws ApiException {
}
}
}
//error info- code: 400 reason: "Invalid order" model: <none>
public void placeOrder (Order body) throws ApiException {
//error info- code: 400 reason: "Invalid ID supplied" model: <none>
//error info- code: 404 reason: "Order not found" model: <none>
public Order getOrderById (String orderId) throws ApiException {
// verify required params are set
if(body == null ) {
if(orderId == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
String path = "/store/order".replaceAll("\\{format\\}","json");
String path = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString()));

// query params
Map<String, String> queryParams = new HashMap<String, String>();
Expand All @@ -108,16 +108,16 @@ public void placeOrder (Order body) throws ApiException {
String contentType = "application/json";

try {
String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, contentType);
String response = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, null, headerParams, contentType);
if(response != null){
return ;
return (Order) ApiInvoker.deserialize(response, "", Order.class);
}
else {
return ;
return null;
}
} catch (ApiException ex) {
if(ex.getCode() == 404) {
return ;
return null;
}
else {
throw ex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ public void logoutUser () throws ApiException {
}
}
}
public void createUser (User body) throws ApiException {
public void createUsersWithArrayInput (List<User> body) throws ApiException {
// verify required params are set
if(body == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
String path = "/user".replaceAll("\\{format\\}","json");
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");

// query params
Map<String, String> queryParams = new HashMap<String, String>();
Expand All @@ -219,13 +219,13 @@ public void createUser (User body) throws ApiException {
}
}
}
public void createUsersWithArrayInput (List<User> body) throws ApiException {
public void createUsersWithListInput (List<User> body) throws ApiException {
// verify required params are set
if(body == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
String path = "/user/createWithArray".replaceAll("\\{format\\}","json");
String path = "/user/createWithList".replaceAll("\\{format\\}","json");

// query params
Map<String, String> queryParams = new HashMap<String, String>();
Expand All @@ -250,13 +250,13 @@ public void createUsersWithArrayInput (List<User> body) throws ApiException {
}
}
}
public void createUsersWithListInput (List<User> body) throws ApiException {
public void createUser (User body) throws ApiException {
// verify required params are set
if(body == null ) {
throw new ApiException(400, "missing required params");
}
// create path and map variables
String path = "/user/createWithList".replaceAll("\\{format\\}","json");
String path = "/user".replaceAll("\\{format\\}","json");

// query params
Map<String, String> queryParams = new HashMap<String, String>();
Expand Down
Loading