Skip to content

Commit

Permalink
[android] Regenerate samples
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Jun 13, 2024
1 parent a12807d commit 5b99f6f
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0-SNAPSHOT
7.7.0-SNAPSHOT
14 changes: 7 additions & 7 deletions samples/client/petstore/android/httpclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ 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


Expand All @@ -134,6 +127,13 @@ 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

Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/android/httpclient/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {

ext {
swagger_annotations_version = "1.6.6"
gson_version = "2.8.9"
gson_version = "2.10.1"
httpclient_version = "4.5.13"
httpcore_version = "4.4.4"
junit_version = "4.13"
Expand All @@ -75,9 +75,9 @@ afterEvaluate {
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
task.from variant.javaCompile.destinationDirectory
task.destinationDirectory = project.file("${project.buildDir}/outputs/jar")
task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions samples/client/petstore/android/httpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemProperties>
<systemPropertyVariables>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
</systemPropertyVariables>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
Expand Down Expand Up @@ -172,7 +172,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-core-version>1.6.6</swagger-core-version>
<gson-version>2.8.9</gson-version>
<gson-version>2.10.1</gson-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13.2</junit-version>
<httpclient-version>4.5.13</httpclient-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ public String getMessage() {
public void setMessage(String message) {
this.message = message;
}

@Override
public String toString() {
return "ApiException{" +
"code=" + code +
", message=" + message +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import org.openapitools.client.model.ApiResponse;
import java.io.File;
import java.util.*;
import org.openapitools.client.model.Pet;

import org.apache.http.entity.mime.MultipartEntityBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0-SNAPSHOT
7.7.0-SNAPSHOT
14 changes: 7 additions & 7 deletions samples/client/petstore/android/volley/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ 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


Expand All @@ -134,6 +127,13 @@ 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

Expand Down
21 changes: 15 additions & 6 deletions samples/client/petstore/android/volley/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ android {
lintOptions {
abortOnError false
}
packagingOptions {
resources.excludes += "META-INF/DEPENDENCIES"
}

// Rename the aar correctly
libraryVariants.all { variant ->
Expand All @@ -58,8 +61,9 @@ android {

ext {
swagger_annotations_version = "1.6.6"
gson_version = "2.8.9"
httpmime_version = "4.5.13"
gson_version = "2.10.1"
httpcore_version = "4.4.16"
httpmime_version = "4.5.14"
volley_version = "1.2.1"
junit_version = "4.13.2"
robolectric_version = "4.5.1"
Expand All @@ -69,7 +73,12 @@ ext {
dependencies {
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
implementation "com.google.code.gson:gson:$gson_version"
implementation "org.apache.httpcomponents:httpmime:$httpmime_version"
implementation ("org.apache.httpcomponents:httpcore:$httpcore_version") {
exclude(group: "org.apache.httpcomponents", module: "httpclient")
}
implementation ("org.apache.httpcomponents:httpmime:$httpmime_version") {
exclude(group: "org.apache.httpcomponents", module: "httpclient")
}
implementation "com.android.volley:volley:${volley_version}"
testImplementation "junit:junit:$junit_version"
testImplementation "org.robolectric:robolectric:${robolectric_version}"
Expand All @@ -81,9 +90,9 @@ afterEvaluate {
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
task.from variant.javaCompile.destinationDirectory
task.destinationDirectory = project.file("${project.buildDir}/outputs/jar")
task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions samples/client/petstore/android/volley/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.6.6</swagger-annotations-version>
<httpcomponents-httpmime-version>4.5.13</httpcomponents-httpmime-version>
<google-code-gson-version>2.8.9</google-code-gson-version>
<httpcomponents-httpmime-version>4.5.14</httpcomponents-httpmime-version>
<google-code-gson-version>2.10.1</google-code-gson-version>
<volley-library-version>1.2.1</volley-library-version>
<android-platform-version>4.1.1.4</android-platform-version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,12 @@ public String getMessage() {
public void setMessage(String message) {
this.message = message;
}

@Override
public String toString() {
return "ApiException{" +
"code=" + code +
", message=" + message +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ public static void initializeInstance(Cache cache, Network network, int threadPo

// Setup authentications (key: authentication name, value: authentication).
INSTANCE.authentications = new HashMap<String, Authentication>();
INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
// TODO: comment out below as OAuth does not exist
//INSTANCE.authentications.put("petstore_auth", new OAuth());
INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
// Prevent the authentications from being modified.
INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.openapitools.client.model.ApiResponse;
import java.io.File;
import java.util.*;
import org.openapitools.client.model.Pet;

import org.apache.http.HttpEntity;
Expand Down

0 comments on commit 5b99f6f

Please sign in to comment.