From 6af14524b43822fe46a8a7f970c1dac8c382473d Mon Sep 17 00:00:00 2001 From: Nathan Herring Date: Tue, 28 Jun 2022 16:17:47 -0700 Subject: [PATCH] Replace `JacksonFactory` with `GsonFactory`. Fixes #210. --- endpoints-framework/build.gradle | 3 +-- .../src/main/java/com/google/api/server/spi/Client.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/endpoints-framework/build.gradle b/endpoints-framework/build.gradle index 1645cea6..53abf52e 100644 --- a/endpoints-framework/build.gradle +++ b/endpoints-framework/build.gradle @@ -87,9 +87,8 @@ dependencies { compile group: 'com.google.appengine', name: 'appengine-api-1.0-sdk', version: appengineVersion compile group: 'com.google.flogger', name: 'flogger', version: floggerVersion runtime group: 'com.google.flogger', name: 'flogger-system-backend', version: floggerVersion - compile(group: 'com.google.http-client', name: 'google-http-client-jackson2', version: apiclientVersion) { + compile(group: 'com.google.http-client', name: 'google-http-client-gson', version: apiclientVersion) { exclude group: 'com.google.guava', module: 'guava-jdk5' - exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core' } compile(group: 'com.google.api-client', name: 'google-api-client', version: apiclientVersion) { exclude group: 'com.google.guava', module: 'guava-jdk5' diff --git a/endpoints-framework/src/main/java/com/google/api/server/spi/Client.java b/endpoints-framework/src/main/java/com/google/api/server/spi/Client.java index 42e74f3e..abf23fe6 100644 --- a/endpoints-framework/src/main/java/com/google/api/server/spi/Client.java +++ b/endpoints-framework/src/main/java/com/google/api/server/spi/Client.java @@ -23,7 +23,7 @@ import com.google.api.client.http.javanet.NetHttpTransport; import com.google.api.client.json.JsonFactory; import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.json.jackson2.JacksonFactory; +import com.google.api.client.json.gson.GsonFactory; import com.google.common.annotations.VisibleForTesting; /** @@ -43,7 +43,7 @@ public class Client { } else { transport = new NetHttpTransport(); } - jsonFactory = new JacksonFactory(); + jsonFactory = GsonFactory.getDefaultInstance(); jsonHttpRequestFactory = transport.createRequestFactory(new HttpRequestInitializer() { @Override public void initialize(HttpRequest request) {