Skip to content

Commit

Permalink
Update generated build files for REST Assured (OpenAPITools#5873)
Browse files Browse the repository at this point in the history
* REST Assured 4.3.0
* Jackson 2.10.3
* Gson 2.8.6, GSON-Fire 1.8.4
* Okio 1.17.5
* Joda-Time 2.10.5
* ThreeTenBP 1.4.3
* Added missing dependencies for Bean Validation
* Added missing dependencies for `@Generated` annotation
* Refresh REST Assured sample project
  • Loading branch information
joschi authored and MikailBag committed May 31, 2020
1 parent 854bd89 commit 49f0eb9
Show file tree
Hide file tree
Showing 57 changed files with 364 additions and 81 deletions.
2 changes: 1 addition & 1 deletion bin/java-petstore-rest-assured.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} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/rest-assured -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured.json -o samples/client/petstore/java/rest-assured --additional-properties hideGenerationTimestamp=true --additional-properties booleanGetterPrefix=is $@"
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/rest-assured -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured.json -o samples/client/petstore/java/rest-assured --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is $@"

echo "Removing files and folders under samples/client/petstore/java/rest-assured/src/main"
rm -rf samples/client/petstore/java/rest-assured/src/main
Expand Down
2 changes: 1 addition & 1 deletion docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 248,7 @@ CONFIG OPTIONS
retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
rest-assured - HTTP client: rest-assured : 4.0.0. JSON processing: Gson 2.8.5. Only for Java8
rest-assured - HTTP client: rest-assured : 4.3.0. JSON processing: Gson 2.8.6. Only for Java8
```
Your config file for Java can look like
Expand Down
2 changes: 1 addition & 1 deletion docs/generators/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 28,7 @@ sidebar_label: java
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|invokerPackage|root package for generated code| |org.openapitools.client|
|java8|Option. Use Java8 classes instead of third party equivalents|<dl><dt>**true**</dt><dd>Use Java 8 classes such as Base64</dd><dt>**false**</dt><dd>Various third party libraries as needed</dd></dl>|false|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 9.x (deprecated) or 10.x (default). JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit**</dt><dd>HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11 </dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x</dd></dl>|okhttp-gson|
|library|library template (sub-template) to use|<dl><dt>**jersey1**</dt><dd>HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.</dd><dt>**jersey2**</dt><dd>HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x</dd><dt>**feign**</dt><dd>HTTP client: OpenFeign 9.x (deprecated) or 10.x (default). JSON processing: Jackson 2.9.x.</dd><dt>**okhttp-gson**</dt><dd>[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.</dd><dt>**retrofit**</dt><dd>HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.</dd><dt>**retrofit2**</dt><dd>HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)</dd><dt>**resttemplate**</dt><dd>HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x</dd><dt>**webclient**</dt><dd>HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x</dd><dt>**resteasy**</dt><dd>HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**vertx**</dt><dd>HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x</dd><dt>**google-api-client**</dt><dd>HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x</dd><dt>**rest-assured**</dt><dd>HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8</dd><dt>**native**</dt><dd>HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11 </dd><dt>**microprofile**</dt><dd>HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x</dd></dl>|okhttp-gson|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.client.model|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 153,7 @@ public JavaClientCodegen() {
supportedLibraries.put(RESTEASY, "HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x");
supportedLibraries.put(VERTX, "HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x");
supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x");
supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8");
supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8");
supportedLibraries.put(NATIVE, "HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11 ");
supportedLibraries.put(MICROPROFILE, "HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 96,24 @@ if(hasProperty('target') && target == 'android') {

ext {
swagger_annotations_version = "1.5.21"
rest_assured_version = "4.0.0"
rest_assured_version = "4.3.0"
junit_version = "4.13"
{{#jackson}}
jackson_version = "2.10.1"
jackson_databind_version = "2.9.10"
jackson_version = "2.10.3"
jackson_databind_version = "2.10.3"
jackson_databind_nullable_version = 0.2.1
{{/jackson}}
{{#gson}}
gson_version = "2.8.5"
gson_fire_version = "1.8.3"
gson_version = "2.8.6"
gson_fire_version = "1.8.4"
{{/gson}}
{{#joda}}
jodatime_version = "2.9.9"
jodatime_version = "2.10.5"
{{/joda}}
{{#threetenbp}}
threetenbp_version = "1.4.0"
threetenbp_version = "1.4.3"
{{/threetenbp}}
okio_version = "1.13.0"
okio_version = "1.17.5"
}

dependencies {
Expand All @@ -138,5 138,11 @@ dependencies {
compile "org.threeten:threetenbp:$threetenbp_version"
{{/threetenbp}}
compile "com.squareup.okio:okio:$okio_version"
{{#useBeanValidation}}
compile "javax.validation:validation-api:2.0.1.Final"
{{/useBeanValidation}}
{{#performBeanValidation}}
compile "org.hibernate:hibernate-validator:6.0.19.Final"
{{/performBeanValidation}}
testCompile "junit:junit:$junit_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 10,29 @@ lazy val root = (project in file(".")).
resolvers = Resolver.mavenLocal,
libraryDependencies = Seq(
"io.swagger" % "swagger-annotations" % "1.5.21",
"io.rest-assured" % "scala-support" % "4.0.0",
"io.rest-assured" % "scala-support" % "4.3.0",
{{#jackson}}
"com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "compile",
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile",
{{/jackson}}
{{#gson}}
"com.google.code.gson" % "gson" % "2.8.5",
"io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
"com.google.code.gson" % "gson" % "2.8.6",
"io.gsonfire" % "gson-fire" % "1.8.4" % "compile",
{{/gson}}
{{#joda}}
"joda-time" % "joda-time" % "2.9.9" % "compile",
"joda-time" % "joda-time" % "2.10.5" % "compile",
{{/joda}}
{{#threetenbp}}
"org.threeten" % "threetenbp" % "1.4.0" % "compile",
"org.threeten" % "threetenbp" % "1.4.3" % "compile",
{{/threetenbp}}
"com.squareup.okio" % "okio" % "1.13.0" % "compile",
"com.squareup.okio" % "okio" % "1.17.5" % "compile",
{{#useBeanValidation}}
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
{{/useBeanValidation}}
{{#performBeanValidation}}
"org.hibernate" % "hibernate-validator" "6.0.19.Final" % "compile",
{{/performBeanValidation}}
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 43,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-maven</id>
Expand All @@ -53,7 53,7 @@
<configuration>
<rules>
<requireMavenVersion>
<version>2.2.0</version>
<version>3.0.5</version>
</requireMavenVersion>
</rules>
</configuration>
Expand All @@ -63,17 63,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<version>2.22.2</version>
<configuration>
<systemProperties>
<property>
<name>loggerPath</name>
<value>conf/log4j.properties</value>
</property>
</systemProperties>
<argLine>-Xms512m -Xmx1500m</argLine>
<parallel>methods</parallel>
<forkMode>pertest</forkMode>
<reuseForks>false</reuseForks>
<forkCount>1C</forkCount>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -111,6 110,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>add_sources</id>
Expand Down Expand Up @@ -141,7 141,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -150,7 150,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
<configuration>
<doclint>none</doclint>
</configuration>
Expand All @@ -166,7 166,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -187,7 187,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -203,6 203,20 @@
</profile>
</profiles>

{{#jackson}}
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${jackson-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
{{/jackson}}

<dependencies>
<dependency>
<groupId>io.swagger</groupId>
Expand All @@ -215,6 229,14 @@
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
{{^hideGenerationTimestamp}}
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<scope>provided</scope>
</dependency>
{{/hideGenerationTimestamp}}
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
Expand Down Expand Up @@ -253,17 275,14 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind-version}</version>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
Expand All @@ -274,21 293,18 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson-version}</version>
</dependency>
{{/withXml}}
{{#joda}}
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
{{/joda}}
{{#java8}}
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
{{/java8}}
{{#threetenbp}}
Expand All @@ -304,6 320,23 @@
<artifactId>okio</artifactId>
<version>${okio-version}</version>
</dependency>
{{#useBeanValidation}}
<!-- Bean Validation API support -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<scope>provided</scope>
</dependency>
{{/useBeanValidation}}
{{#performBeanValidation}}
<!-- Bean Validation Impl. used to perform BeanValidation -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.19.Final</version>
</dependency>
{{/performBeanValidation}}
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
Expand All @@ -315,25 348,23 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.21</swagger-annotations-version>
<rest-assured.version>4.0.0</rest-assured.version>
<gson-version>2.8.5</gson-version>
<gson-fire-version>1.8.3</gson-fire-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<rest-assured.version>4.3.0</rest-assured.version>
<gson-version>2.8.6</gson-version>
<gson-fire-version>1.8.4</gson-fire-version>
{{#joda}}
<jodatime-version>2.9.9</jodatime-version>
<jodatime-version>2.10.5</jodatime-version>
{{/joda}}
{{#threetenbp}}
<threetenbp-version>1.4.0</threetenbp-version>
<threetenbp-version>1.4.3</threetenbp-version>
{{/threetenbp}}
{{#jackson}}
<jackson-version>2.10.1</jackson-version>
<jackson-databind-version>2.9.10</jackson-databind-version>
<jackson-version>2.10.3</jackson-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
{{#threetenbp}}
<jackson-threetenbp-version>2.9.10</jackson-threetenbp-version>
<jackson-threetenbp-version>2.10.0</jackson-threetenbp-version>
{{/threetenbp}}
{{/jackson}}
<okio-version>1.13.0</okio-version>
<okio-version>1.17.5</okio-version>
<junit-version>4.13</junit-version>
</properties>
</project>
12 changes: 7 additions & 5 deletions samples/client/petstore/java/rest-assured/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 96,12 @@ if(hasProperty('target') && target == 'android') {

ext {
swagger_annotations_version = "1.5.21"
rest_assured_version = "4.0.0"
rest_assured_version = "4.3.0"
junit_version = "4.13"
gson_version = "2.8.5"
gson_fire_version = "1.8.3"
threetenbp_version = "1.4.0"
okio_version = "1.13.0"
gson_version = "2.8.6"
gson_fire_version = "1.8.4"
threetenbp_version = "1.4.3"
okio_version = "1.17.5"
}

dependencies {
Expand All @@ -112,5 112,7 @@ dependencies {
compile 'com.google.code.gson:gson:$gson_version'
compile "org.threeten:threetenbp:$threetenbp_version"
compile "com.squareup.okio:okio:$okio_version"
compile "javax.validation:validation-api:2.0.1.Final"
compile "org.hibernate:hibernate-validator:6.0.19.Final"
testCompile "junit:junit:$junit_version"
}
Loading

0 comments on commit 49f0eb9

Please sign in to comment.