-
-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Labels
2.18cborhas-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue
Description
When deserializing CBOR with string references enabled using jackson-dataformats-binary, if the original string being referenced is in a field ignored by an annotation such as @JsonIgnoreProperties
, the string reference cannot be resolved, causing an exception.
version: 2.17.1
record APub(String a, String b) {}
@JsonIgnoreProperties(ignoreUnknown = true)
record ASub(String b) {}
@Test
public void testCborDecode() throws IOException {
var mapper = CBORMapper.builder.enable(CBORGenerator.Feature.STRINGREF).build();
var aPub = new APub("foo", "foo"); // second occurrence of `foo` will be a stringref
var aSer = mapper.writeValueAsBytes(aPub);
var aSub = mapper.readValue(aSer, ASub.class); // <- throws com.fasterxml.jackson.core.JsonParseException: String reference (0) out of range:
}
Metadata
Metadata
Assignees
Labels
2.18cborhas-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue