Skip to content

Commit 6f80c1e

Browse files
committed
Merge branch '3.0' into 3.x
2 parents b32fff1 + d01833e commit 6f80c1e

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

release-notes/VERSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ No changes since 3.0.0
2727

2828
#106: (yaml) Upgrade to `snakeyaml-engine` (from classic `snakeyaml`)
2929
(contributed by Andrey S)
30+
#215: (yaml) .without(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)
31+
seems to be ignored
32+
(reported by @jdimeo)
3033
#320: Rename "com.fasterxml.jackson" -> "tools.jackson"
3134
#374: (csv) Should verify that escape character set if enabling
3235
`CsvGenerator.Feature.ESCAPE_QUOTE_CHAR_WITH_ESCAPE_CHAR`

release-notes/VERSION-2.x

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Active Maintainers:
1818

1919
No changes since 2.20
2020

21+
2.20.1 (30-Oct-2025)
22+
23+
No changes since 2.20.0
24+
2125
2.20.0 (28-Aug-2025)
2226

2327
#497: (csv, toml, yaml): `UTF8Reader` throws "Need to move partially decoded character;
@@ -28,6 +32,8 @@ No changes since 2.20
2832
for non-numeric tokens
2933
- Generate SBOMs [JSTEP-14]
3034

35+
2.19.4 (29-Oct-2025)
36+
2.19.3 (29-Oct-2025)
3137
2.19.2 (18-Jul-2025)
3238
2.19.1 (13-Jun-2025)
3339

@@ -47,6 +53,7 @@ No changes since 2.19.0
4753
#554: (csv) Enforce, document thread-safety of `CsvSchema`
4854
(requested by Gili T)
4955

56+
2.18.5 (27-Oct-2025)
5057
2.18.4 (06-May-2025)
5158
2.18.3 (28-Feb-2025)
5259
2.18.2 (27-Nov-2024)
@@ -155,6 +162,8 @@ No changes since 2.15.1
155162
(contributed by Axel N)
156163
#390: (yaml) Upgrade to Snakeyaml 2.0 (resolves CVE-2022-1471)
157164
(contributed by @pjfanning)
165+
#398 (tom) TOML: check nesting depth (CVE-2023-3894)
166+
(contributed by @pjfanning)
158167
#411: (toml) Fuzzer-found issue #57237 (buffer boundary condition)
159168
(contributed by @yawkat)
160169
#415: (yaml) Use `LoaderOptions.allowDuplicateKeys` to enforce duplicate key detection
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package tools.jackson.dataformat.yaml.tofix;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import com.fasterxml.jackson.annotation.JsonCreator;
6+
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
7+
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
8+
import tools.jackson.databind.ObjectMapper;
9+
import tools.jackson.dataformat.yaml.ModuleTestBase;
10+
import tools.jackson.dataformat.yaml.testutil.failure.JacksonTestFailureExpected;
11+
12+
import static org.junit.jupiter.api.Assertions.assertEquals;
13+
import static org.junit.jupiter.api.Assertions.assertNotNull;
14+
import static org.junit.jupiter.api.Assertions.assertSame;
15+
16+
// [dataformats-text#296]: YAML Anchor and alias fails with ObjectIdGenerators.None
17+
public class ObjectIdNone296Test extends ModuleTestBase
18+
{
19+
private final ObjectMapper MAPPER = newObjectMapper();
20+
21+
@JacksonTestFailureExpected
22+
@Test
23+
public void testObjectIdUsingNativeAnchorsWithNoneGenerator() throws Exception
24+
{
25+
// YAML content with anchor (&foo1) and alias (*foo1)
26+
final String YAML_CONTENT =
27+
"foo: &foo1\n" +
28+
" value: bar\n" +
29+
"boo: *foo1\n";
30+
31+
// This should work: YAML anchors/aliases should be recognized natively
32+
// when using ObjectIdGenerators.None, but currently fails with:
33+
// "Cannot construct instance of StringHolder... no String-argument
34+
// constructor/factory method to deserialize from String value ('foo1')"
35+
ScratchModel result = MAPPER.readValue(YAML_CONTENT, ScratchModel.class);
36+
37+
assertNotNull(result);
38+
assertNotNull(result.foo);
39+
assertEquals("bar", result.foo.value);
40+
assertNotNull(result.boo);
41+
assertEquals("bar", result.boo.value);
42+
// The key assertion: both fields should point to the same object instance
43+
assertSame(result.foo, result.boo);
44+
}
45+
46+
static class ScratchModel {
47+
public StringHolder foo;
48+
public StringHolder boo;
49+
}
50+
51+
// Using ObjectIdGenerators.None should allow YAML's native anchor/alias to work
52+
@JsonIdentityInfo(generator = ObjectIdGenerators.None.class)
53+
static class StringHolder {
54+
public String value;
55+
56+
protected StringHolder() { }
57+
58+
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
59+
public StringHolder(String v) { value = v; }
60+
61+
@Override
62+
public String toString() {
63+
return "StringHolder{" + value +" }";
64+
}
65+
}
66+
}

0 commit comments

Comments
 (0)