Skip to content

Commit d1a213e

Browse files
committed
Fix #2149 (add MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES)
1 parent 5dfd86f commit d1a213e

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Project: jackson-databind
66

77
2.10.0-final (not yet released)
88

9+
#2149: Add `MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES`
10+
(suggested by Craig P)
911
#2309: READ_ENUMS_USING_TO_STRING doesn't support null values
1012
(reported, fix suggested by Ben A)
1113
#2442: `ArrayNode.addAll()` adds raw `null` values which cause NPE on `deepCopy()`

src/main/java/com/fasterxml/jackson/databind/MapperFeature.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public enum MapperFeature implements ConfigFeature
361361
*<p>
362362
* Note that there is additional performance overhead since incoming property
363363
* names need to be lower-cased before comparison, for cases where there are upper-case
364-
* letters. Overhead for names that are already lower-case should be negligible however.
364+
* letters. Overhead for names that are already lower-case should be negligible.
365365
*<p>
366366
* Feature is disabled by default.
367367
*
@@ -373,7 +373,7 @@ public enum MapperFeature implements ConfigFeature
373373
/**
374374
* Feature that determines if Enum deserialization should be case sensitive or not.
375375
* If enabled, Enum deserialization will ignore case, that is, case of incoming String
376-
* value and enum id (dependant on other settings, either `name()`, `toString()`, or
376+
* value and enum id (depending on other settings, either `name()`, `toString()`, or
377377
* explicit override) do not need to match.
378378
* <p>
379379
* Feature is disabled by default.
@@ -382,6 +382,20 @@ public enum MapperFeature implements ConfigFeature
382382
*/
383383
ACCEPT_CASE_INSENSITIVE_ENUMS(false),
384384

385+
/**
386+
* Feature that permits parsing some enumerated text-based value types but ignoring the case
387+
* of the values on deserialization: for example, date/time type deserializers.
388+
* Support for this feature depends on deserializer implementations using it.
389+
*<p>
390+
* Note, however, that regular {@code Enum} types follow {@link #ACCEPT_CASE_INSENSITIVE_ENUMS}
391+
* setting instead.
392+
*<p>
393+
* Feature is disabled by default.
394+
*
395+
* @since 2.10
396+
*/
397+
ACCEPT_CASE_INSENSITIVE_VALUES(false),
398+
385399
/**
386400
* Feature that can be enabled to make property names be
387401
* overridden by wrapper name (usually detected with annotations

0 commit comments

Comments
 (0)