Skip to content

Commit d9fe34a

Browse files
authored
Update java client samples OAS2 (#140)
* Update java client examples * Rename artifactId in json config files * Add imports in api.mustache for play24 and play25
1 parent c354181 commit d9fe34a

File tree

873 files changed

+17410
-16047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

873 files changed

+17410
-16047
lines changed

bin/android-petstore-volley.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "volley",
3-
"artifactId": "swagger-petstore-android-volley"
3+
"artifactId": "petstore-android-volley"
44
}

bin/java-petstore-feign.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "feign",
3-
"artifactId": "swagger-petstore-feign"
3+
"artifactId": "petstore-feign"
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "google-api-client",
3-
"artifactId": "swagger-petstore-google-api-client"
3+
"artifactId": "petstore-google-api-client"
44
}

bin/java-petstore-jersey1.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="$@ generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -o samples/client/petstore/java/jersey1 -DhideGenerationTimestamp=true --library=jersey1"
30+
ags="$@ generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -o samples/client/petstore/java/jersey1 -DhideGenerationTimestamp=true --library=jersey1"
3131

3232
echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main"
3333
rm -rf samples/client/petstore/java/jersey1/src/main

bin/java-petstore-jersey2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "jersey2",
3-
"artifactId": "swagger-petstore-jersey2"
3+
"artifactId": "petstore-jersey2"
44
}

bin/java-petstore-okhttp-gson-parcelable.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="$@ generate -t modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel -DhideGenerationTimestamp=true,parcelableModel=true"
30+
ags="$@ generate --artifact-id petstore-okhttp-gson-parcelableModel -t modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel -DhideGenerationTimestamp=true,parcelableModel=true"
3131

3232
rm -rf samples/client/petstore/java/okhttp-gson-parcelableModel/src/main
3333
find samples/client/petstore/java/okhttp-gson-parcelableModel -maxdepth 1 -type f ! -name "README.md" -exec rm {} +

bin/java-petstore-okhttp-gson.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "okhttp-gson",
3-
"artifactId": "swagger-petstore-okhttp-gson"
3+
"artifactId": "petstore-okhttp-gson"
44
}

bin/java-petstore-rest-assured.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "rest-assured",
3-
"artifactId": "swagger-petstore-rest-assured"
3+
"artifactId": "petstore-rest-assured"
44
}

bin/java-petstore-resteasy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "resteasy",
3-
"artifactId": "swagger-petstore-resteasy"
3+
"artifactId": "petstore-resteasy"
44
}

bin/java-petstore-resttemplate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "resttemplate",
3-
"artifactId": "swagger-petstore-resttemplate"
3+
"artifactId": "petstore-resttemplate"
44
}

bin/java-petstore-retrofit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "retrofit",
3-
"artifactId": "swagger-petstore-retrofit"
3+
"artifactId": "petstore-retrofit"
44
}

bin/java-petstore-retrofit2-play24.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play24.json -o samples/client/petstore/java/retrofit2-play24 -DhideGenerationTimestamp=true"
30+
ags="$@ generate --artifact-id petstore-java-client-retrofit2-play24 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play24.json -o samples/client/petstore/java/retrofit2-play24 -DhideGenerationTimestamp=true"
3131

3232
echo "Removing files and folders under samples/client/petstore/java/retrofit2-play24/src/main"
3333
rm -rf samples/client/petstore/java/retrofit2-play24/src/main

bin/java-petstore-retrofit2-play25.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play25.json -o samples/client/petstore/java/retrofit2-play25 -DhideGenerationTimestamp=true"
30+
ags="$@ generate --artifact-id petstore-java-client-retrofit2-play25 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2-play25.json -o samples/client/petstore/java/retrofit2-play25 -DhideGenerationTimestamp=true"
3131

3232
echo "Removing files and folders under samples/client/petstore/java/retrofit2-play25/src/main"
3333
rm -rf samples/client/petstore/java/retrofit2-play25/src/main

bin/java-petstore-retrofit2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "retrofit2",
3-
"artifactId": "swagger-petstore-retrofit2"
3+
"artifactId": "petstore-retrofit2"
44
}

bin/java-petstore-retrofit2rx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "retrofit2",
3-
"artifactId": "swagger-petstore-retrofit2-rx"
3+
"artifactId": "petstore-retrofit2-rx"
44
}

bin/java-petstore-retrofit2rx2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "retrofit2",
3-
"artifactId": "swagger-petstore-retrofit2-rx2"
3+
"artifactId": "petstore-retrofit2-rx2"
44
}

bin/java-petstore-vertx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "vertx",
3-
"artifactId": "swagger-petstore-vertx"
3+
"artifactId": "petstore-vertx"
44
}

bin/java8-petstore-jersey2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"library": "jersey2",
3-
"artifactId": "swagger-petstore-jersey2",
3+
"artifactId": "petstore-jersey2",
44
"dateLibrary": "java8"
55
}

bin/java8-petstore-jersey2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fi
2727

2828
# if you've executed sbt assembly previously it will use that instead.
2929
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java8-petstore-jersey2.json -o samples/client/petstore/java/jersey2-java8 -DhideGenerationTimestamp=true"
30+
ags="$@ generate --artifact-id petstore-jersey2-java8 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java8-petstore-jersey2.json -o samples/client/petstore/java/jersey2-java8 -DhideGenerationTimestamp=true"
3131

3232
echo "Removing files and folders under samples/client/petstore/java/jersey2-java8/src/main"
3333
rm -rf samples/client/petstore/java/jersey2-java8/src/main

bin/spring-cloud-feign-petstore.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "spring-cloud",
3-
"artifactId": "swagger-petstore-spring-cloud"
3+
"artifactId": "petstore-spring-cloud"
44
}

bin/spring-mvc-petstore-j8-async.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"java8": true,
33
"async": true,
44
"library": "spring-mvc",
5-
"artifactId": "swagger-spring-mvc-server-j8-async"
5+
"artifactId": "spring-mvc-server-j8-async"
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"library": "spring-mvc",
33
"dateLibrary": "java8-localdatetime",
4-
"artifactId": "swagger-spring-mvc-j8-localdatetime"
4+
"artifactId": "spring-mvc-j8-localdatetime"
55
}

bin/spring-mvc-petstore-server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"library": "spring-mvc",
3-
"artifactId": "swagger-spring-mvc-server"
3+
"artifactId": "spring-mvc-server"
44
}

modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {{invokerPackage}}.CollectionFormats.*;
88
import retrofit2.http.*;
99

1010
import okhttp3.RequestBody;
11+
import okhttp3.ResponseBody;
12+
import okhttp3.MultipartBody;
1113

1214
{{#imports}}import {{import}};
1315
{{/imports}}

modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {{invokerPackage}}.CollectionFormats.*;
88
import retrofit2.http.*;
99

1010
import okhttp3.RequestBody;
11+
import okhttp3.ResponseBody;
12+
import okhttp3.MultipartBody;
1113

1214
{{#imports}}import {{import}};
1315
{{/imports}}

samples/client/petstore/java/feign/.openapi-generator-ignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Swagger Codegen Ignore
2-
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
33

44
# Use this file to prevent files from being overwritten by the generator.
55
# The patterns follow closely to .gitignore or .dockerignore.
66

77
# As an example, the C# client generator defines ApiClient.cs.
8-
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
99
#ApiClient.cs
1010

1111
# You can match any string of characters against a directory, file or extension with a single asterisk (*):

samples/client/petstore/java/feign/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# swagger-petstore-feign
1+
# petstore-feign
22

33
## Requirements
44

@@ -24,8 +24,8 @@ After the client library is installed/deployed, you can use it in your Maven pro
2424

2525
```xml
2626
<dependency>
27-
<groupId>io.swagger</groupId>
28-
<artifactId>swagger-petstore-feign</artifactId>
27+
<groupId>org.openapitools</groupId>
28+
<artifactId>petstore-feign</artifactId>
2929
<version>1.0.0</version>
3030
<scope>compile</scope>
3131
</dependency>
@@ -34,7 +34,7 @@ After the client library is installed/deployed, you can use it in your Maven pro
3434

3535
## Recommendation
3636

37-
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue.
37+
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
3838

3939
## Author
4040

samples/client/petstore/java/feign/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

4-
group = 'io.swagger'
4+
group = 'org.openapitools'
55
version = '1.0.0'
66

77
buildscript {
@@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') {
8383

8484
install {
8585
repositories.mavenInstaller {
86-
pom.artifactId = 'swagger-petstore-feign'
86+
pom.artifactId = 'petstore-feign'
8787
}
8888
}
8989

samples/client/petstore/java/feign/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
lazy val root = (project in file(".")).
22
settings(
3-
organization := "io.swagger",
4-
name := "swagger-petstore-feign",
3+
organization := "org.openapitools",
4+
name := "petstore-feign",
55
version := "1.0.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),

samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/Animal.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/ArrayTest.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/Cat.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/Category.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/Dog.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/EnumClass.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

samples/client/petstore/java/feign/docs/EnumTest.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)