Skip to content

Commit 654c82d

Browse files
authored
Merge pull request #141 from pards/2.10
Issue 80 (jackson-modules-java8): support case-insensitive dates
2 parents 6860566 + 46981b8 commit 654c82d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/main/java/com/fasterxml/jackson/annotation/JsonFormat.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,14 @@ public enum Feature {
253253
*/
254254
ACCEPT_CASE_INSENSITIVE_PROPERTIES,
255255

256+
/**
257+
* Override for <code>MapperFeature.ACCEPT_CASE_INSENSITIVE_VALUES</code>.
258+
* Only affects deserialization, has no effect on serialization.
259+
*
260+
* @since 2.10
261+
*/
262+
ACCEPT_CASE_INSENSITIVE_VALUES,
263+
256264
/**
257265
* Override for <code>SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS</code>,
258266
* similar constraints apply.

src/test/java/com/fasterxml/jackson/annotation/FormatTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,17 @@ public void testLeniency() {
186186
assertFalse(dunno.equals(lenient));
187187
}
188188

189+
public void testCaseInsensitiveValues() {
190+
JsonFormat.Value empty = JsonFormat.Value.empty();
191+
assertNull(empty.getFeature(Feature.ACCEPT_CASE_INSENSITIVE_VALUES));
192+
193+
JsonFormat.Value insensitive = empty.withFeature(Feature.ACCEPT_CASE_INSENSITIVE_VALUES);
194+
assertTrue(insensitive.getFeature(Feature.ACCEPT_CASE_INSENSITIVE_VALUES));
195+
196+
JsonFormat.Value sensitive = empty.withoutFeature(Feature.ACCEPT_CASE_INSENSITIVE_VALUES);
197+
assertFalse(sensitive.getFeature(Feature.ACCEPT_CASE_INSENSITIVE_VALUES));
198+
}
199+
189200
public void testShape() {
190201
assertFalse(JsonFormat.Shape.STRING.isNumeric());
191202
assertFalse(JsonFormat.Shape.STRING.isStructured());

0 commit comments

Comments
 (0)