diff --git a/src/main/java/org/github/flytreeleft/nexus3/keycloak/plugin/internal/http/HttpMethodResponse.java b/src/main/java/org/github/flytreeleft/nexus3/keycloak/plugin/internal/http/HttpMethodResponse.java index 6c12bd1..75dc533 100644 --- a/src/main/java/org/github/flytreeleft/nexus3/keycloak/plugin/internal/http/HttpMethodResponse.java +++ b/src/main/java/org/github/flytreeleft/nexus3/keycloak/plugin/internal/http/HttpMethodResponse.java @@ -1,6 +1,9 @@ package org.github.flytreeleft.nexus3.keycloak.plugin.internal.http; +import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.introspect.VisibilityChecker; import org.keycloak.util.JsonSerialization; import java.io.IOException; @@ -33,6 +36,8 @@ public HttpMethodResponse json(final TypeReference responseType) { public R execute() { return method.execute((InputStream inputStream) -> { try { + JsonSerialization.mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + JsonSerialization.mapper.setVisibility(VisibilityChecker.Std.defaultInstance().withFieldVisibility(JsonAutoDetect.Visibility.ANY)); return JsonSerialization.readValue(inputStream, responseType); } catch (IOException e) { throw new RuntimeException("Error parsing JSON response.", e);