Skip to content

Commit

Permalink
Update java client samples OAS2 (#140)
Browse files Browse the repository at this point in the history
* Update java client examples
* Rename artifactId in json config files
* Add imports in api.mustache for play24 and play25
  • Loading branch information
jmini authored Apr 24, 2018
1 parent 5340c35 commit c8c316e
Show file tree
Hide file tree
Showing 873 changed files with 17,410 additions and 16,047 deletions.
2 changes: 1 addition & 1 deletion bin/android-petstore-volley.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "volley",
"artifactId": "swagger-petstore-android-volley"
"artifactId": "petstore-android-volley"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-feign.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "feign",
"artifactId": "swagger-petstore-feign"
"artifactId": "petstore-feign"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-google-api-client.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "google-api-client",
"artifactId": "swagger-petstore-google-api-client"
"artifactId": "petstore-google-api-client"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-jersey1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
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"
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"

echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main"
rm -rf samples/client/petstore/java/jersey1/src/main
Expand Down
2 changes: 1 addition & 1 deletion bin/java-petstore-jersey2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "jersey2",
"artifactId": "swagger-petstore-jersey2"
"artifactId": "petstore-jersey2"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-okhttp-gson-parcelable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
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"
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"

rm -rf samples/client/petstore/java/okhttp-gson-parcelableModel/src/main
find samples/client/petstore/java/okhttp-gson-parcelableModel -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
Expand Down
2 changes: 1 addition & 1 deletion bin/java-petstore-okhttp-gson.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "okhttp-gson",
"artifactId": "swagger-petstore-okhttp-gson"
"artifactId": "petstore-okhttp-gson"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-rest-assured.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "rest-assured",
"artifactId": "swagger-petstore-rest-assured"
"artifactId": "petstore-rest-assured"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-resteasy.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "resteasy",
"artifactId": "swagger-petstore-resteasy"
"artifactId": "petstore-resteasy"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-resttemplate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "resttemplate",
"artifactId": "swagger-petstore-resttemplate"
"artifactId": "petstore-resttemplate"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-retrofit.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "retrofit",
"artifactId": "swagger-petstore-retrofit"
"artifactId": "petstore-retrofit"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-retrofit2-play24.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
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"
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"

echo "Removing files and folders under samples/client/petstore/java/retrofit2-play24/src/main"
rm -rf samples/client/petstore/java/retrofit2-play24/src/main
Expand Down
2 changes: 1 addition & 1 deletion bin/java-petstore-retrofit2-play25.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
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"
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"

echo "Removing files and folders under samples/client/petstore/java/retrofit2-play25/src/main"
rm -rf samples/client/petstore/java/retrofit2-play25/src/main
Expand Down
2 changes: 1 addition & 1 deletion bin/java-petstore-retrofit2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "retrofit2",
"artifactId": "swagger-petstore-retrofit2"
"artifactId": "petstore-retrofit2"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-retrofit2rx.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "retrofit2",
"artifactId": "swagger-petstore-retrofit2-rx"
"artifactId": "petstore-retrofit2-rx"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-retrofit2rx2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "retrofit2",
"artifactId": "swagger-petstore-retrofit2-rx2"
"artifactId": "petstore-retrofit2-rx2"
}
2 changes: 1 addition & 1 deletion bin/java-petstore-vertx.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "vertx",
"artifactId": "swagger-petstore-vertx"
"artifactId": "petstore-vertx"
}
2 changes: 1 addition & 1 deletion bin/java8-petstore-jersey2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"library": "jersey2",
"artifactId": "swagger-petstore-jersey2",
"artifactId": "petstore-jersey2",
"dateLibrary": "java8"
}
2 changes: 1 addition & 1 deletion bin/java8-petstore-jersey2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
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"
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"

echo "Removing files and folders under samples/client/petstore/java/jersey2-java8/src/main"
rm -rf samples/client/petstore/java/jersey2-java8/src/main
Expand Down
2 changes: 1 addition & 1 deletion bin/spring-cloud-feign-petstore.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "spring-cloud",
"artifactId": "swagger-petstore-spring-cloud"
"artifactId": "petstore-spring-cloud"
}
2 changes: 1 addition & 1 deletion bin/spring-mvc-petstore-j8-async.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"java8": true,
"async": true,
"library": "spring-mvc",
"artifactId": "swagger-spring-mvc-server-j8-async"
"artifactId": "spring-mvc-server-j8-async"
}
2 changes: 1 addition & 1 deletion bin/spring-mvc-petstore-j8-localdatetime.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"library": "spring-mvc",
"dateLibrary": "java8-localdatetime",
"artifactId": "swagger-spring-mvc-j8-localdatetime"
"artifactId": "spring-mvc-j8-localdatetime"
}
2 changes: 1 addition & 1 deletion bin/spring-mvc-petstore-server.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"library": "spring-mvc",
"artifactId": "swagger-spring-mvc-server"
"artifactId": "spring-mvc-server"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {{invokerPackage}}.CollectionFormats.*;
import retrofit2.http.*;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;

{{#imports}}import {{import}};
{{/imports}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {{invokerPackage}}.CollectionFormats.*;
import retrofit2.http.*;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import okhttp3.MultipartBody;

{{#imports}}import {{import}};
{{/imports}}
Expand Down
6 changes: 3 additions & 3 deletions samples/client/petstore/java/feign/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

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

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

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/java/feign/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# swagger-petstore-feign
# petstore-feign

## Requirements

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

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

## Recommendation

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

## Author

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/java/feign/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'io.swagger'
group = 'org.openapitools'
version = '1.0.0'

buildscript {
Expand Down Expand Up @@ -83,7 +83,7 @@ if(hasProperty('target') && target == 'android') {

install {
repositories.mavenInstaller {
pom.artifactId = 'swagger-petstore-feign'
pom.artifactId = 'petstore-feign'
}
}

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/java/feign/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lazy val root = (project in file(".")).
settings(
organization := "io.swagger",
name := "swagger-petstore-feign",
organization := "org.openapitools",
name := "petstore-feign",
version := "1.0.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions samples/client/petstore/java/feign/docs/Animal.md

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md

This file was deleted.

12 changes: 0 additions & 12 deletions samples/client/petstore/java/feign/docs/ArrayTest.md

This file was deleted.

12 changes: 0 additions & 12 deletions samples/client/petstore/java/feign/docs/Cat.md

This file was deleted.

11 changes: 0 additions & 11 deletions samples/client/petstore/java/feign/docs/Category.md

This file was deleted.

12 changes: 0 additions & 12 deletions samples/client/petstore/java/feign/docs/Dog.md

This file was deleted.

14 changes: 0 additions & 14 deletions samples/client/petstore/java/feign/docs/EnumClass.md

This file was deleted.

36 changes: 0 additions & 36 deletions samples/client/petstore/java/feign/docs/EnumTest.md

This file was deleted.

Loading

0 comments on commit c8c316e

Please sign in to comment.