From 95eb06e2e935a89878a8d5ad49db9072a986dcaf Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 27 Jun 2016 11:25:15 +0800 Subject: [PATCH 1/2] add http client dependency to android volley --- .../android/libraries/volley/build.mustache | 6 ++++-- .../resources/android/libraries/volley/pom.mustache | 6 ++++++ samples/client/petstore/android/volley/.gitignore | 2 +- samples/client/petstore/android/volley/README.md | 12 ++++++------ samples/client/petstore/android/volley/build.gradle | 6 ++++-- .../volley/gradle/wrapper/gradle-wrapper.properties | 2 +- samples/client/petstore/android/volley/pom.xml | 6 ++++++ .../main/java/io/swagger/client/ApiException.java | 8 ++++---- .../main/java/io/swagger/client/model/Category.java | 2 +- .../src/main/java/io/swagger/client/model/Order.java | 2 +- .../src/main/java/io/swagger/client/model/Pet.java | 2 +- .../src/main/java/io/swagger/client/model/Tag.java | 2 +- .../src/main/java/io/swagger/client/model/User.java | 2 +- .../io/swagger/client/request/DeleteRequest.java | 2 +- .../java/io/swagger/client/request/GetRequest.java | 2 +- .../java/io/swagger/client/request/PatchRequest.java | 2 +- .../java/io/swagger/client/request/PostRequest.java | 2 +- .../java/io/swagger/client/request/PutRequest.java | 2 +- 18 files changed, 42 insertions(+), 26 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache index 917f9d11ef..74f1aafd64 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/build.mustache @@ -59,8 +59,9 @@ android { ext { swagger_annotations_version = "1.5.0" gson_version = "2.3.1" - httpclient_version = "4.5.2" + httpmime_version = "4.5.2" httpcore_version = "4.4.4" + httpclient_version = "4.3.3" volley_version = "1.0.19" junit_version = "4.12" robolectric_version = "3.0" @@ -71,7 +72,8 @@ dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.google.code.gson:gson:$gson_version" compile "org.apache.httpcomponents:httpcore:$httpcore_version" - compile "org.apache.httpcomponents:httpmime:$httpclient_version" + compile "org.apache.httpcomponents:httpmime:$httpmime_version" + compile "org.apache.httpcomponents:httpclient-android:$httpclient_version" compile "com.mcxiaoke.volley:library:${volley_version}@aar" testCompile "junit:junit:$junit_version" testCompile "org.robolectric:robolectric:${robolectric_version}" diff --git a/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache b/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache index 80ba5feaca..9c4c99da9a 100644 --- a/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/libraries/volley/pom.mustache @@ -16,6 +16,11 @@ httpcore ${httpcomponents-httpcore-version} + + org.apache.httpcomponents + httpclient-android + ${httpcomponents-httpclient-version} + org.apache.httpcomponents httpmime @@ -54,6 +59,7 @@ 1.5.8 4.4.4 4.5.2 + 4.3.3 2.6.2 1.0.19 4.1.1.4 diff --git a/samples/client/petstore/android/volley/.gitignore b/samples/client/petstore/android/volley/.gitignore index a7b72d554d..a836875126 100644 --- a/samples/client/petstore/android/volley/.gitignore +++ b/samples/client/petstore/android/volley/.gitignore @@ -36,4 +36,4 @@ captures/ *.iml # Keystore files -*.jks \ No newline at end of file +*.jks diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index 6f0a2c65f9..e4aa474824 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -116,6 +116,12 @@ Class | Method | HTTP request | Description ## Documentation for Authorization Authentication schemes defined for the API: +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ### petstore_auth - **Type**: OAuth @@ -125,12 +131,6 @@ Authentication schemes defined for the API: - write:pets: modify pets in your account - read:pets: read your pets -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## Recommendation diff --git a/samples/client/petstore/android/volley/build.gradle b/samples/client/petstore/android/volley/build.gradle index f794267c73..ab26beea6f 100644 --- a/samples/client/petstore/android/volley/build.gradle +++ b/samples/client/petstore/android/volley/build.gradle @@ -53,8 +53,9 @@ android { ext { swagger_annotations_version = "1.5.0" gson_version = "2.3.1" - httpclient_version = "4.5.2" + httpmime_version = "4.5.2" httpcore_version = "4.4.4" + httpclient_version = "4.3.3" volley_version = "1.0.19" junit_version = "4.12" robolectric_version = "3.0" @@ -65,7 +66,8 @@ dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.google.code.gson:gson:$gson_version" compile "org.apache.httpcomponents:httpcore:$httpcore_version" - compile "org.apache.httpcomponents:httpmime:$httpclient_version" + compile "org.apache.httpcomponents:httpmime:$httpmime_version" + compile "org.apache.httpcomponents:httpclient-android:$httpclient_version" compile "com.mcxiaoke.volley:library:${volley_version}@aar" testCompile "junit:junit:$junit_version" testCompile "org.robolectric:robolectric:${robolectric_version}" diff --git a/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties index 1bbc424ca7..fa452523ac 100644 --- a/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties +++ b/samples/client/petstore/android/volley/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Mon May 16 21:00:31 CST 2016 +#Mon May 16 21:00:11 CST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index d3ce92aeb9..eed477b639 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -16,6 +16,11 @@ httpcore ${httpcomponents-httpcore-version} + + org.apache.httpcomponents + httpclient-android + ${httpcomponents-httpclient-version} + org.apache.httpcomponents httpmime @@ -54,6 +59,7 @@ 1.5.8 4.4.4 4.5.2 + 4.3.3 2.6.2 1.0.19 4.1.1.4 diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java index 31bc8a0978..6147e87317 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/ApiException.java @@ -14,16 +14,16 @@ public class ApiException extends Exception { public int getCode() { return code; } - + public void setCode(int code) { this.code = code; } - + public String getMessage() { return message; } - + public void setMessage(String message) { this.message = message; } -} \ No newline at end of file +} diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Category.java index f5d5ea86b6..f3537ac56f 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Category.java @@ -47,7 +47,7 @@ public class Category { (name == null ? category.name == null : name.equals(category.name)); } - @Override + @Override public int hashCode() { int result = 17; result = 31 * result + (id == null ? 0: id.hashCode()); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Order.java index f184238f71..0054dbc1ba 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Order.java @@ -104,7 +104,7 @@ public class Order { (complete == null ? order.complete == null : complete.equals(order.complete)); } - @Override + @Override public int hashCode() { int result = 17; result = 31 * result + (id == null ? 0: id.hashCode()); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Pet.java index e471a300a3..b9d996cd76 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Pet.java @@ -106,7 +106,7 @@ public class Pet { (status == null ? pet.status == null : status.equals(pet.status)); } - @Override + @Override public int hashCode() { int result = 17; result = 31 * result + (id == null ? 0: id.hashCode()); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Tag.java index 722e9194eb..05b540d161 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/Tag.java @@ -47,7 +47,7 @@ public class Tag { (name == null ? tag.name == null : name.equals(tag.name)); } - @Override + @Override public int hashCode() { int result = 17; result = 31 * result + (id == null ? 0: id.hashCode()); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/User.java index 4f0a64671e..4875b14661 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/model/User.java @@ -126,7 +126,7 @@ public class User { (userStatus == null ? user.userStatus == null : userStatus.equals(user.userStatus)); } - @Override + @Override public int hashCode() { int result = 17; result = 31 * result + (id == null ? 0: id.hashCode()); diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/DeleteRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/DeleteRequest.java index 141fa5a106..802a53f652 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/DeleteRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/DeleteRequest.java @@ -89,4 +89,4 @@ public class DeleteRequest extends Request { return headers; } -} \ No newline at end of file +} diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/GetRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/GetRequest.java index 91be40c66a..639c73d82f 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/GetRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/GetRequest.java @@ -36,4 +36,4 @@ public class GetRequest extends StringRequest{ return headers; } -} \ No newline at end of file +} diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PatchRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PatchRequest.java index 252141eb97..30c93b34e7 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PatchRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PatchRequest.java @@ -89,4 +89,4 @@ public class PatchRequest extends Request { return headers; } -} \ No newline at end of file +} diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PostRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PostRequest.java index 7cbe01b701..753725d27d 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PostRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PostRequest.java @@ -89,4 +89,4 @@ public class PostRequest extends Request { return headers; } -} \ No newline at end of file +} diff --git a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PutRequest.java b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PutRequest.java index f3b9c64832..c43979a8f6 100644 --- a/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PutRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/io/swagger/client/request/PutRequest.java @@ -89,4 +89,4 @@ public class PutRequest extends Request { return headers; } -} \ No newline at end of file +} From 7f5b391f80ba5da0c86ceec47a52eb291e6ee974 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 27 Jun 2016 11:27:30 +0800 Subject: [PATCH 2/2] run ruby test first --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 195d49aa88..37cd5602fb 100644 --- a/pom.xml +++ b/pom.xml @@ -569,8 +569,8 @@ - samples/client/petstore/python samples/client/petstore/ruby + samples/client/petstore/python samples/client/petstore/typescript-fetch/tests/default samples/client/petstore/typescript-fetch/builds/default samples/client/petstore/typescript-fetch/builds/es6-target