Skip to content

Commit 2761e4b

Browse files
committed
Tweaks to #244 fix, update release notes
1 parent 32bdc37 commit 2761e4b

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

release-notes/CREDITS-2.x

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Suminda Sirinath Salpitikorala Dharmasena (sirinath@github)
179179
(2.13.0)
180180

181181
Jonas Konrad (yawkat@github)
182-
#219: Add TOML (https://en.wikipedia.org/wiki/TOML) support
182+
* Contributed #219: Add TOML (https://en.wikipedia.org/wiki/TOML) support
183183
(2.13.0)
184184

185185
Krzysztof Debski (kdebski85@github)
@@ -191,7 +191,7 @@ PJ Fanning (pjfanning@github)
191191
#283: (csv) `CsvSchema.getColumnDesc()` returns unpaired square bracket when columns
192192
are empty
193193
(2.13.0)
194-
#314: (csv) Add fast floating-point parsing, generation support
194+
* Contributed #314: (csv) Add fast floating-point parsing, generation support
195195
(2.14.0)
196196

197197
Falk Hanisch (mrpiggi@github)
@@ -208,6 +208,13 @@ Esteban Ginez (eginez@github)
208208
(2.13.2)
209209

210210
Jim Talbut (Yaytay@github)
211-
#169: Need a way to escape dots in property keys (add path separator configuration)
211+
#169: (properties) Need a way to escape dots in property keys (add path separator configuration)
212212
(2.14.0)
213213

214+
Simon Dean (msmsimondean@github)
215+
* Requested #244: (yaml) Add `YAMLGenerator.Feature.ALLOW_LONG_KEYS` to allow writing keys
216+
longer than 128 characters (default)
217+
218+
Shauni Arima (ShauniArima@github)
219+
* Contributed #244: (yaml) Add `YAMLGenerator.Feature.ALLOW_LONG_KEYS` to allow writing keys
220+
longer than 128 characters (default)

release-notes/VERSION-2.x

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ Active Maintainers:
1616

1717
2.14.0 (not yet released)
1818

19-
#169: Need a way to escape dots in property keys (add path separator configuration)
19+
#169: (properties) Need a way to escape dots in property keys (add path separator configuration)
2020
(contributed by Jim T)
21+
#244: (yaml) Add `YAMLGenerator.Feature.ALLOW_LONG_KEYS` to allow writing keys longer than
22+
128 characters (default)
23+
(requested by Simon D)
24+
(contributed by Shauni A)
2125
#285: (csv) Missing columns from header line (compare to `CsvSchema`) not detected
2226
when reordering columns (add `CsvParser.Feature.FAIL_ON_MISSING_HEADER_COLUMNS`)
2327
(reported by Björn M)

yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLGenerator.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,17 @@ public enum Feature implements FormatFeature // since 2.9
139139
USE_PLATFORM_LINE_BREAKS(false),
140140

141141
/**
142-
* Option passed to SnakeYAML to enable usage of key longer that 128 characters.
143-
* If disabled, the max key length is set to 128 characters.
142+
* Option passed to SnakeYAML to allows writing key longer that 128 characters
143+
* (up to 1024 characters).
144+
* If disabled, the max key length is left as 128 characters: longer names
145+
* are truncated. If enabled, limit is raised to 1024 characters.
144146
* <p>
145-
* Default value is {@code false}.
147+
* Default value is {@code false} for backwards-compatibility (same as behavior
148+
* before this feature was added).
146149
*
147150
* @since 2.14
148151
*/
149-
USE_LONG_KEYS(false),
152+
ALLOW_LONG_KEYS(false),
150153
;
151154

152155
protected final boolean _defaultState;
@@ -321,7 +324,7 @@ protected DumperOptions buildDumperOptions(int jsonFeatures, int yamlFeatures,
321324
opt.setLineBreak(DumperOptions.LineBreak.getPlatformLineBreak());
322325
}
323326

324-
if (Feature.USE_LONG_KEYS.enabledIn(_formatFeatures)) {
327+
if (Feature.ALLOW_LONG_KEYS.enabledIn(_formatFeatures)) {
325328
opt.setMaxSimpleKeyLength(1024);
326329
}
327330
return opt;

yaml/src/test/java/com/fasterxml/jackson/dataformat/yaml/ser/GeneratorFeatureTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void testLongKeys() throws Exception
7474
assertEquals("---\n? " + LONG_KEY + "\n: \"value\"",
7575
_trim(defaultMapper.writeValueAsString(inputValue)));
7676

77-
ObjectMapper longKeysMapper = YAMLMapper.builder().enable(YAMLGenerator.Feature.USE_LONG_KEYS).build();
77+
ObjectMapper longKeysMapper = YAMLMapper.builder().enable(YAMLGenerator.Feature.ALLOW_LONG_KEYS).build();
7878
assertEquals("---\n" + LONG_KEY + ": \"value\"",
7979
_trim(longKeysMapper.writeValueAsString(inputValue)));
8080
}

0 commit comments

Comments
 (0)