Skip to content

Commit e48a49e

Browse files
committed
bump jackson version to 2.9.9 in java jersey2
1 parent 1a45ab5 commit e48a49e

Some content is hidden

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

50 files changed

+966
-1188
lines changed

bin/java-petstore-jersey2.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"library": "jersey2",
3+
"dateLibrary": "java8",
34
"artifactId": "swagger-petstore-jersey2"
45
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.6-SNAPSHOT
1+
3.0.11-SNAPSHOT

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ if(hasProperty('target') && target == 'android') {
3232
targetSdkVersion 25
3333
}
3434
compileOptions {
35-
sourceCompatibility JavaVersion.VERSION_1_7
36-
targetCompatibility JavaVersion.VERSION_1_7
35+
sourceCompatibility JavaVersion.VERSION_1_8
36+
targetCompatibility JavaVersion.VERSION_1_8
3737
}
3838

3939
// Rename the aar correctly
@@ -77,8 +77,8 @@ if(hasProperty('target') && target == 'android') {
7777

7878
apply plugin: 'java'
7979
apply plugin: 'maven'
80-
sourceCompatibility = JavaVersion.VERSION_1_7
81-
targetCompatibility = JavaVersion.VERSION_1_7
80+
sourceCompatibility = JavaVersion.VERSION_1_8
81+
targetCompatibility = JavaVersion.VERSION_1_8
8282

8383
install {
8484
repositories.mavenInstaller {
@@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') {
9494

9595
ext {
9696
swagger_annotations_version = "2.0.0"
97-
jackson_version = "2.8.9"
97+
jackson_version = "2.9.9"
9898
jersey_version = "2.25.1"
9999
junit_version = "4.12"
100100
}
@@ -107,7 +107,6 @@ dependencies {
107107
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
108108
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
109109
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
110-
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version",
111-
compile "com.brsanthu:migbase64:2.2"
110+
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version",
112111
testCompile "junit:junit:$junit_version"
113112
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ lazy val root = (project in file(".")).
1313
"org.glassfish.jersey.core" % "jersey-client" % "2.25.1",
1414
"org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1",
1515
"org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1",
16-
"com.fasterxml.jackson.core" % "jackson-core" % "2.6.4" % "compile",
17-
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.4" % "compile",
18-
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.4" % "compile",
19-
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile",
20-
"com.brsanthu" % "migbase64" % "2.2",
16+
"com.fasterxml.jackson.core" % "jackson-core" % "2.9.9" % "compile",
17+
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.9" % "compile",
18+
"com.fasterxml.jackson.core" % "jackson-databind" % "2.9.9" % "compile",
19+
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.9" % "compile",
2120
"junit" % "junit" % "4.12" % "test",
2221
"com.novocode" % "junit-interface" % "0.10" % "test"
2322
)

samples/client/petstore/java/jersey2/docs/StoreApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This endpoint does not need any parameter.
9393

9494
### Return type
9595

96-
[**Map<String, Integer>**](Map.md)
96+
**Map<String, Integer>**
9797

9898
### Authorization
9999

samples/client/petstore/java/jersey2/pom.xml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@
119119
<artifactId>maven-compiler-plugin</artifactId>
120120
<version>3.6.1</version>
121121
<configuration>
122-
<source>1.7</source>
123-
<target>1.7</target>
122+
<source>1.8</source>
123+
<target>1.8</target>
124124
</configuration>
125125
</plugin>
126126
<plugin>
@@ -217,16 +217,10 @@
217217
<version>${jackson-version}</version>
218218
</dependency>
219219
<dependency>
220-
<groupId>com.github.joschi.jackson</groupId>
221-
<artifactId>jackson-datatype-threetenbp</artifactId>
220+
<groupId>com.fasterxml.jackson.datatype</groupId>
221+
<artifactId>jackson-datatype-jsr310</artifactId>
222222
<version>${jackson-version}</version>
223223
</dependency>
224-
<!-- Base64 encoding that works in both JVM and Android -->
225-
<dependency>
226-
<groupId>com.brsanthu</groupId>
227-
<artifactId>migbase64</artifactId>
228-
<version>2.2</version>
229-
</dependency>
230224
<!-- test dependencies -->
231225
<dependency>
232226
<groupId>junit</groupId>
@@ -238,7 +232,7 @@
238232
<properties>
239233
<swagger-core-version>2.0.0</swagger-core-version>
240234
<jersey-version>2.25.1</jersey-version>
241-
<jackson-version>2.6.4</jackson-version>
235+
<jackson-version>2.9.9</jackson-version>
242236
<maven-plugin-version>1.0.0</maven-plugin-version>
243237
<junit-version>4.12</junit-version>
244238
</properties>

samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,11 @@ public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Objec
674674
}
675675
}
676676

677-
Invocation.Builder invocationBuilder = target.request().accept(accept);
677+
Invocation.Builder invocationBuilder = target.request();
678+
679+
if (accept != null) {
680+
invocationBuilder = invocationBuilder.accept(accept);
681+
}
678682

679683
for (Entry<String, String> entry : headerParams.entrySet()) {
680684
String value = entry.getValue();

samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/CustomInstantDeserializer.java

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

samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package io.swagger.client;
22

3-
import org.threeten.bp.*;
43
import com.fasterxml.jackson.annotation.*;
54
import com.fasterxml.jackson.databind.*;
6-
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
5+
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
76

87
import java.text.DateFormat;
98

@@ -21,11 +20,7 @@ public JSON() {
2120
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
2221
mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
2322
mapper.setDateFormat(new RFC3339DateFormat());
24-
ThreeTenModule module = new ThreeTenModule();
25-
module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
26-
module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
27-
module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
28-
mapper.registerModule(module);
23+
mapper.registerModule(new JavaTimeModule());
2924
}
3025

3126
/**

0 commit comments

Comments
 (0)