Support for GSON Decoder in Java Feign Generator (#14254)

* Supporting Gson decoder in Feign

* Supporting Gson decoder in Feign

* Fixing test failures - and ensuring Jackson is used as the default if nothing selected (back compatible)

* Adding in sample files

* Updating docs

* Switching to echo server version

* Adding feign-gson to the github workflow

* Empty-Commit
This commit is contained in:
John Mitchell
2022-12-17 07:40:14 +00:00
committed by GitHub
parent 081a6ef466
commit 2a33229158
51 changed files with 3557 additions and 11 deletions

View File

@@ -6,7 +6,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import feign.okhttp.OkHttpClient;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -44,8 +43,8 @@ public class ApiClient {
private Feign.Builder feignBuilder;
public ApiClient() {
objectMapper = createObjectMapper();
apiAuthorizations = new LinkedHashMap<String, RequestInterceptor>();
objectMapper = createObjectMapper();
feignBuilder = Feign.builder()
.client(new OkHttpClient())
.encoder(new FormEncoder(new JacksonEncoder(objectMapper)))
@@ -148,6 +147,7 @@ public class ApiClient {
}
}
public ObjectMapper getObjectMapper(){
return objectMapper;
}