Skip to content

Commit 49f0eb9

Browse files
joschiMikailBag
authored andcommitted
Update generated build files for REST Assured (OpenAPITools#5873)
* 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
1 parent 854bd89 commit 49f0eb9

Some content is hidden

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

57 files changed

+364
-81
lines changed

bin/java-petstore-rest-assured.sh

+1-1
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} -Xmx1024M -DloggerPath=conf/log4j.properties"
30-
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 $@"
30+
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 $@"
3131

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

docs/customization.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ CONFIG OPTIONS
248248
retrofit - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1 (Retrofit 1.9.0)
249249
retrofit2 - HTTP client: OkHttp 2.5.0. JSON processing: Gson 2.4 (Retrofit 2.0.0-beta2)
250250
google-api-client - HTTP client: google-api-client 1.23.0. JSON processing: Jackson 2.8.9
251-
rest-assured - HTTP client: rest-assured : 4.0.0. JSON processing: Gson 2.8.5. Only for Java8
251+
rest-assured - HTTP client: rest-assured : 4.3.0. JSON processing: Gson 2.8.6. Only for Java8
252252
```
253253
254254
Your config file for Java can look like

docs/generators/java.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ sidebar_label: java
2828
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
2929
|invokerPackage|root package for generated code| |org.openapitools.client|
3030
|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|
31-
|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|
31+
|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|
3232
|licenseName|The name of the license| |Unlicense|
3333
|licenseUrl|The URL of the license| |http://unlicense.org|
3434
|modelPackage|package for generated models| |org.openapitools.client.model|

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public JavaClientCodegen() {
153153
supportedLibraries.put(RESTEASY, "HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x");
154154
supportedLibraries.put(VERTX, "HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x");
155155
supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x");
156-
supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8");
156+
supportedLibraries.put(REST_ASSURED, "HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8");
157157
supportedLibraries.put(NATIVE, "HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+");
158158
supportedLibraries.put(MICROPROFILE, "HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x");
159159

modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache

+14-8
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,24 @@ if(hasProperty('target') && target == 'android') {
9696

9797
ext {
9898
swagger_annotations_version = "1.5.21"
99-
rest_assured_version = "4.0.0"
99+
rest_assured_version = "4.3.0"
100100
junit_version = "4.13"
101101
{{#jackson}}
102-
jackson_version = "2.10.1"
103-
jackson_databind_version = "2.9.10"
102+
jackson_version = "2.10.3"
103+
jackson_databind_version = "2.10.3"
104104
jackson_databind_nullable_version = 0.2.1
105105
{{/jackson}}
106106
{{#gson}}
107-
gson_version = "2.8.5"
108-
gson_fire_version = "1.8.3"
107+
gson_version = "2.8.6"
108+
gson_fire_version = "1.8.4"
109109
{{/gson}}
110110
{{#joda}}
111-
jodatime_version = "2.9.9"
111+
jodatime_version = "2.10.5"
112112
{{/joda}}
113113
{{#threetenbp}}
114-
threetenbp_version = "1.4.0"
114+
threetenbp_version = "1.4.3"
115115
{{/threetenbp}}
116-
okio_version = "1.13.0"
116+
okio_version = "1.17.5"
117117
}
118118

119119
dependencies {
@@ -138,5 +138,11 @@ dependencies {
138138
compile "org.threeten:threetenbp:$threetenbp_version"
139139
{{/threetenbp}}
140140
compile "com.squareup.okio:okio:$okio_version"
141+
{{#useBeanValidation}}
142+
compile "javax.validation:validation-api:2.0.1.Final"
143+
{{/useBeanValidation}}
144+
{{#performBeanValidation}}
145+
compile "org.hibernate:hibernate-validator:6.0.19.Final"
146+
{{/performBeanValidation}}
141147
testCompile "junit:junit:$junit_version"
142148
}

modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache

+15-9
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,29 @@ lazy val root = (project in file(".")).
1010
resolvers += Resolver.mavenLocal,
1111
libraryDependencies ++= Seq(
1212
"io.swagger" % "swagger-annotations" % "1.5.21",
13-
"io.rest-assured" % "scala-support" % "4.0.0",
13+
"io.rest-assured" % "scala-support" % "4.3.0",
1414
{{#jackson}}
15-
"com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile",
16-
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile",
17-
"com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "compile",
15+
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile",
16+
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile",
17+
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile",
1818
{{/jackson}}
1919
{{#gson}}
20-
"com.google.code.gson" % "gson" % "2.8.5",
21-
"io.gsonfire" % "gson-fire" % "1.8.3" % "compile",
20+
"com.google.code.gson" % "gson" % "2.8.6",
21+
"io.gsonfire" % "gson-fire" % "1.8.4" % "compile",
2222
{{/gson}}
2323
{{#joda}}
24-
"joda-time" % "joda-time" % "2.9.9" % "compile",
24+
"joda-time" % "joda-time" % "2.10.5" % "compile",
2525
{{/joda}}
2626
{{#threetenbp}}
27-
"org.threeten" % "threetenbp" % "1.4.0" % "compile",
27+
"org.threeten" % "threetenbp" % "1.4.3" % "compile",
2828
{{/threetenbp}}
29-
"com.squareup.okio" % "okio" % "1.13.0" % "compile",
29+
"com.squareup.okio" % "okio" % "1.17.5" % "compile",
30+
{{#useBeanValidation}}
31+
"javax.validation" % "validation-api" % "2.0.1.Final" % "compile",
32+
{{/useBeanValidation}}
33+
{{#performBeanValidation}}
34+
"org.hibernate" % "hibernate-validator" "6.0.19.Final" % "compile",
35+
{{/performBeanValidation}}
3036
"junit" % "junit" % "4.13" % "test",
3137
"com.novocode" % "junit-interface" % "0.10" % "test"
3238
)

modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache

+57-26
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<plugin>
4444
<groupId>org.apache.maven.plugins</groupId>
4545
<artifactId>maven-enforcer-plugin</artifactId>
46-
<version>3.0.0-M1</version>
46+
<version>3.0.0-M3</version>
4747
<executions>
4848
<execution>
4949
<id>enforce-maven</id>
@@ -53,7 +53,7 @@
5353
<configuration>
5454
<rules>
5555
<requireMavenVersion>
56-
<version>2.2.0</version>
56+
<version>3.0.5</version>
5757
</requireMavenVersion>
5858
</rules>
5959
</configuration>
@@ -63,17 +63,16 @@
6363
<plugin>
6464
<groupId>org.apache.maven.plugins</groupId>
6565
<artifactId>maven-surefire-plugin</artifactId>
66-
<version>2.12</version>
66+
<version>2.22.2</version>
6767
<configuration>
6868
<systemProperties>
6969
<property>
7070
<name>loggerPath</name>
7171
<value>conf/log4j.properties</value>
7272
</property>
7373
</systemProperties>
74-
<argLine>-Xms512m -Xmx1500m</argLine>
75-
<parallel>methods</parallel>
76-
<forkMode>pertest</forkMode>
74+
<reuseForks>false</reuseForks>
75+
<forkCount>1C</forkCount>
7776
</configuration>
7877
</plugin>
7978
<plugin>
@@ -111,6 +110,7 @@
111110
<plugin>
112111
<groupId>org.codehaus.mojo</groupId>
113112
<artifactId>build-helper-maven-plugin</artifactId>
113+
<version>3.1.0</version>
114114
<executions>
115115
<execution>
116116
<id>add_sources</id>
@@ -141,7 +141,7 @@
141141
<plugin>
142142
<groupId>org.apache.maven.plugins</groupId>
143143
<artifactId>maven-compiler-plugin</artifactId>
144-
<version>3.6.1</version>
144+
<version>3.8.1</version>
145145
<configuration>
146146
<source>1.8</source>
147147
<target>1.8</target>
@@ -150,7 +150,7 @@
150150
<plugin>
151151
<groupId>org.apache.maven.plugins</groupId>
152152
<artifactId>maven-javadoc-plugin</artifactId>
153-
<version>3.1.1</version>
153+
<version>3.2.0</version>
154154
<configuration>
155155
<doclint>none</doclint>
156156
</configuration>
@@ -166,7 +166,7 @@
166166
<plugin>
167167
<groupId>org.apache.maven.plugins</groupId>
168168
<artifactId>maven-source-plugin</artifactId>
169-
<version>2.2.1</version>
169+
<version>3.2.0</version>
170170
<executions>
171171
<execution>
172172
<id>attach-sources</id>
@@ -187,7 +187,7 @@
187187
<plugin>
188188
<groupId>org.apache.maven.plugins</groupId>
189189
<artifactId>maven-gpg-plugin</artifactId>
190-
<version>1.5</version>
190+
<version>1.6</version>
191191
<executions>
192192
<execution>
193193
<id>sign-artifacts</id>
@@ -203,6 +203,20 @@
203203
</profile>
204204
</profiles>
205205

206+
{{#jackson}}
207+
<dependencyManagement>
208+
<dependencies>
209+
<dependency>
210+
<groupId>com.fasterxml.jackson</groupId>
211+
<artifactId>jackson-bom</artifactId>
212+
<version>${jackson-version}</version>
213+
<type>pom</type>
214+
<scope>import</scope>
215+
</dependency>
216+
</dependencies>
217+
</dependencyManagement>
218+
{{/jackson}}
219+
206220
<dependencies>
207221
<dependency>
208222
<groupId>io.swagger</groupId>
@@ -215,6 +229,14 @@
215229
<artifactId>jsr305</artifactId>
216230
<version>3.0.2</version>
217231
</dependency>
232+
{{^hideGenerationTimestamp}}
233+
<dependency>
234+
<groupId>javax.annotation</groupId>
235+
<artifactId>javax.annotation-api</artifactId>
236+
<version>1.3.2</version>
237+
<scope>provided</scope>
238+
</dependency>
239+
{{/hideGenerationTimestamp}}
218240
<dependency>
219241
<groupId>io.rest-assured</groupId>
220242
<artifactId>rest-assured</artifactId>
@@ -253,17 +275,14 @@
253275
<dependency>
254276
<groupId>com.fasterxml.jackson.core</groupId>
255277
<artifactId>jackson-core</artifactId>
256-
<version>${jackson-version}</version>
257278
</dependency>
258279
<dependency>
259280
<groupId>com.fasterxml.jackson.core</groupId>
260281
<artifactId>jackson-annotations</artifactId>
261-
<version>${jackson-version}</version>
262282
</dependency>
263283
<dependency>
264284
<groupId>com.fasterxml.jackson.core</groupId>
265285
<artifactId>jackson-databind</artifactId>
266-
<version>${jackson-databind-version}</version>
267286
</dependency>
268287
<dependency>
269288
<groupId>org.openapitools</groupId>
@@ -274,21 +293,18 @@
274293
<dependency>
275294
<groupId>com.fasterxml.jackson.dataformat</groupId>
276295
<artifactId>jackson-dataformat-xml</artifactId>
277-
<version>${jackson-version}</version>
278296
</dependency>
279297
{{/withXml}}
280298
{{#joda}}
281299
<dependency>
282300
<groupId>com.fasterxml.jackson.datatype</groupId>
283301
<artifactId>jackson-datatype-joda</artifactId>
284-
<version>${jackson-version}</version>
285302
</dependency>
286303
{{/joda}}
287304
{{#java8}}
288305
<dependency>
289306
<groupId>com.fasterxml.jackson.datatype</groupId>
290307
<artifactId>jackson-datatype-jsr310</artifactId>
291-
<version>${jackson-version}</version>
292308
</dependency>
293309
{{/java8}}
294310
{{#threetenbp}}
@@ -304,6 +320,23 @@
304320
<artifactId>okio</artifactId>
305321
<version>${okio-version}</version>
306322
</dependency>
323+
{{#useBeanValidation}}
324+
<!-- Bean Validation API support -->
325+
<dependency>
326+
<groupId>javax.validation</groupId>
327+
<artifactId>validation-api</artifactId>
328+
<version>2.0.1.Final</version>
329+
<scope>provided</scope>
330+
</dependency>
331+
{{/useBeanValidation}}
332+
{{#performBeanValidation}}
333+
<!-- Bean Validation Impl. used to perform BeanValidation -->
334+
<dependency>
335+
<groupId>org.hibernate</groupId>
336+
<artifactId>hibernate-validator</artifactId>
337+
<version>6.0.19.Final</version>
338+
</dependency>
339+
{{/performBeanValidation}}
307340
<!-- test dependencies -->
308341
<dependency>
309342
<groupId>junit</groupId>
@@ -315,25 +348,23 @@
315348
<properties>
316349
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
317350
<swagger-annotations-version>1.5.21</swagger-annotations-version>
318-
<rest-assured.version>4.0.0</rest-assured.version>
319-
<gson-version>2.8.5</gson-version>
320-
<gson-fire-version>1.8.3</gson-fire-version>
321-
<maven-plugin-version>1.0.0</maven-plugin-version>
351+
<rest-assured.version>4.3.0</rest-assured.version>
352+
<gson-version>2.8.6</gson-version>
353+
<gson-fire-version>1.8.4</gson-fire-version>
322354
{{#joda}}
323-
<jodatime-version>2.9.9</jodatime-version>
355+
<jodatime-version>2.10.5</jodatime-version>
324356
{{/joda}}
325357
{{#threetenbp}}
326-
<threetenbp-version>1.4.0</threetenbp-version>
358+
<threetenbp-version>1.4.3</threetenbp-version>
327359
{{/threetenbp}}
328360
{{#jackson}}
329-
<jackson-version>2.10.1</jackson-version>
330-
<jackson-databind-version>2.9.10</jackson-databind-version>
361+
<jackson-version>2.10.3</jackson-version>
331362
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
332363
{{#threetenbp}}
333-
<jackson-threetenbp-version>2.9.10</jackson-threetenbp-version>
364+
<jackson-threetenbp-version>2.10.0</jackson-threetenbp-version>
334365
{{/threetenbp}}
335366
{{/jackson}}
336-
<okio-version>1.13.0</okio-version>
367+
<okio-version>1.17.5</okio-version>
337368
<junit-version>4.13</junit-version>
338369
</properties>
339370
</project>

samples/client/petstore/java/rest-assured/build.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ if(hasProperty('target') && target == 'android') {
9696

9797
ext {
9898
swagger_annotations_version = "1.5.21"
99-
rest_assured_version = "4.0.0"
99+
rest_assured_version = "4.3.0"
100100
junit_version = "4.13"
101-
gson_version = "2.8.5"
102-
gson_fire_version = "1.8.3"
103-
threetenbp_version = "1.4.0"
104-
okio_version = "1.13.0"
101+
gson_version = "2.8.6"
102+
gson_fire_version = "1.8.4"
103+
threetenbp_version = "1.4.3"
104+
okio_version = "1.17.5"
105105
}
106106

107107
dependencies {
@@ -112,5 +112,7 @@ dependencies {
112112
compile 'com.google.code.gson:gson:$gson_version'
113113
compile "org.threeten:threetenbp:$threetenbp_version"
114114
compile "com.squareup.okio:okio:$okio_version"
115+
compile "javax.validation:validation-api:2.0.1.Final"
116+
compile "org.hibernate:hibernate-validator:6.0.19.Final"
115117
testCompile "junit:junit:$junit_version"
116118
}

0 commit comments

Comments
 (0)