Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deserialization of GraphQLErrorDebugInfo #1939

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix deserialization of GraphQLErrorDebugInfo
A recent Jackson upgrade broke deserialization of GraphQLErrorDebugInfo, and the recent fix
broke the existing behavior of collecting unknown properties into the additionalInformation field.
Add an explicit qualifier for the JsonAnySetter annotation so that it gets applied to the backing field
and restores the old behavior, and re-enable the test case now that it passes.
  • Loading branch information
kilink committed Jun 20, 2024
commit 0259340928c99106fcedbd18cbe13eeac1b4a64b
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ data class GraphQLErrorExtensions(
@JsonProperty val classification: Any = ""
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class GraphQLErrorDebugInfo(
@JsonProperty val subquery: String = "",
@JsonProperty val variables: Map<String, Any> = emptyMap(),
@JsonAnySetter @get:JsonAnyGetter
val additionalInformation: Map<String, Any> = hashMapOf()
@field:JsonAnySetter @get:JsonAnyGetter
val additionalInformation: Map<String, Any?> = hashMapOf()
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.netflix.graphql.dgs.client

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
Expand Down Expand Up @@ -179,7 +178,6 @@ class ErrorsTest {
}

@Test
@Disabled("Broken by Jackson 2.17 https://github.com/FasterXML/jackson-databind/issues/4508")
fun errorWithDebugInfo() {
val jsonResponse = """
{
Expand Down
Loading