Skip to content

Commit a019f63

Browse files
authored
[Jackson-3] Address #493, disable DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES by default. (#4625)
1 parent 4ba6db8 commit a019f63

26 files changed

+81
-39
lines changed

release-notes/VERSION

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Versions: 3.x (for earlier see VERSION-2.x)
77

88
3.0.0 (not yet released)
99

10+
#493: Change `DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES` default to `false`
11+
(contributed by Joo-Hyuk K)
1012
#1058: Add a way to pass std and format-specific parser/generator flags during
1113
parser/generation construction
1214
#1600: Serializing locale with underscore, not standard hyphen

src/main/java/tools/jackson/databind/DeserializationFeature.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ public enum DeserializationFeature implements ConfigFeature
110110
* This setting only takes effect after all other handling
111111
* methods for unknown properties have been tried, and
112112
* property remains unhandled.
113+
* Enabling this feature means that a {@link DatabindException}
114+
* will be thrown if an unknown property is encountered.
113115
*<p>
114-
* Feature is enabled by default (meaning that a
115-
* {@link DatabindException} will be thrown if an unknown property
116-
* is encountered).
116+
* Feature is disabled by default as of Jackson 3.0 (in 2.x it was enabled).
117117
*/
118-
FAIL_ON_UNKNOWN_PROPERTIES(true),
118+
FAIL_ON_UNKNOWN_PROPERTIES(false),
119119

120120
/**
121121
* Feature that determines whether encountering of JSON null

src/test-jdk17/java/tools/jackson/databind/records/RecordCreatorsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public String getValue() {
4343
public String accessValueForTest() { return value; }
4444
}
4545

46-
private final ObjectMapper MAPPER = newJsonMapper();
46+
private final ObjectMapper MAPPER = jsonMapperBuilder().enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
4747

4848
/*
4949
/**********************************************************************

src/test-jdk17/java/tools/jackson/databind/records/RecordExplicitCreatorsTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.fasterxml.jackson.annotation.JsonProperty;
99

1010
import tools.jackson.databind.DatabindException;
11+
import tools.jackson.databind.DeserializationFeature;
1112
import tools.jackson.databind.MapperFeature;
1213
import tools.jackson.databind.ObjectMapper;
1314
import tools.jackson.databind.exc.InvalidDefinitionException;
@@ -106,6 +107,7 @@ public static RecordWithExplicitFactoryMethod valueOf(String value) {
106107

107108
private final ObjectMapper MAPPER = jsonMapperBuilder()
108109
.disable(MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS) // So that test cases don't have to assert weird error messages
110+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
109111
.build();
110112

111113
/*

src/test/java/tools/jackson/databind/deser/AnySetterTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ public void testSimpleMapImitation() throws Exception
301301
public void testAnySetterDisable() throws Exception
302302
{
303303
try {
304-
MAPPER.readValue(a2q("{'value':3}"),
305-
MapImitatorDisabled.class);
304+
MAPPER.readerFor(MapImitatorDisabled.class)
305+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
306+
.readValue(a2q("{'value':3}"));
306307
fail("Should not pass");
307308
} catch (UnrecognizedPropertyException e) {
308309
verifyException(e, "Unrecognized property \"value\"");

src/test/java/tools/jackson/databind/deser/IncludeWithDeserTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void testSimpleInclude() throws Exception
125125
@Test
126126
public void testIncludeIgnoredAndUnrecognizedField() throws Exception
127127
{
128-
ObjectReader r = MAPPER.readerFor(OnlyY.class);
128+
ObjectReader r = MAPPER.readerFor(OnlyY.class).with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
129129

130130
// First, fine to get "y" only:
131131
OnlyY result = r.readValue(a2q("{'x':3, 'y': 4}"));

src/test/java/tools/jackson/databind/deser/SetterlessPropertiesDeserTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void testSimpleSetterlessCollectionOk() throws Exception
7474
@Test
7575
public void testSimpleSetterlessCollectionFailure() throws Exception
7676
{
77-
ObjectMapper m = new ObjectMapper();
77+
ObjectMapper m = jsonMapperBuilder().enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
7878
assertFalse(m.isEnabled(MapperFeature.USE_GETTERS_AS_SETTERS));
7979

8080
// and now this should fail
@@ -108,6 +108,7 @@ public void testSimpleSetterlessMapFailure() throws Exception
108108
{
109109
ObjectMapper m = jsonMapperBuilder()
110110
.disable(MapperFeature.USE_GETTERS_AS_SETTERS)
111+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
111112
.build();
112113
// so this should fail now without a setter
113114
try {

src/test/java/tools/jackson/databind/deser/builder/BuilderFailTest.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
import tools.jackson.databind.exc.UnrecognizedPropertyException;
99

1010
import static org.junit.jupiter.api.Assertions.fail;
11-
12-
import static tools.jackson.databind.testutil.DatabindTestUtil.a2q;
13-
import static tools.jackson.databind.testutil.DatabindTestUtil.verifyException;
11+
import static tools.jackson.databind.testutil.DatabindTestUtil.*;
1412

1513
public class BuilderFailTest
1614
{
@@ -68,7 +66,8 @@ public ValueClassXY build() {
6866
/**********************************************************
6967
*/
7068

71-
private final ObjectMapper MAPPER = new ObjectMapper();
69+
private final ObjectMapper MAPPER = jsonMapperBuilder()
70+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
7271

7372
@Test
7473
public void testBuilderMethodReturnInvalidType() throws Exception

src/test/java/tools/jackson/databind/deser/builder/BuilderSimpleTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ private Value2354 build() {
306306
/**********************************************************
307307
*/
308308

309-
private final ObjectMapper MAPPER = newJsonMapper();
309+
private final ObjectMapper MAPPER = jsonMapperBuilder()
310+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
310311

311312
@Test
312313
public void testSimple() throws Exception

src/test/java/tools/jackson/databind/deser/creators/AnySetterForCreator562Test.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ public void testAnySetterViaCreator562Disabled() throws Exception
217217
{
218218
// With 3.0 different fail type, message since we do we get parameter name info
219219
try {
220-
MAPPER.readValue(a2q("{'a':'value', 'b':42, 'c': 111}"),
221-
PojoWithDisabled.class);
220+
MAPPER.readerFor(PojoWithDisabled.class)
221+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
222+
.readValue(a2q("{'a':'value', 'b':42, 'c': 111}"));
222223
fail("Should not pass");
223224
} catch (UnrecognizedPropertyException e) {
224225
verifyException(e, "Unrecognized property \"b\"");

src/test/java/tools/jackson/databind/deser/creators/ConstructorDetectorTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ public void test1ArgDefaultsToPropsMultipleCtors() throws Exception
145145
// 23-May-2024, tatu: Will fail differently with [databind#4515]; default
146146
// constructor available, implicit ones ignored
147147
try {
148-
MAPPER_PROPS.readValue(a2q("{'value' : 137 }"),
149-
SingleArg2CtorsNotAnnotated.class);
148+
MAPPER_PROPS.readerFor(SingleArg2CtorsNotAnnotated.class)
149+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
150+
.readValue(a2q("{'value' : 137 }"));
150151
fail("Should not pass");
151152
} catch (UnrecognizedPropertyException e) {
152153
verifyException(e, "\"value\"");

src/test/java/tools/jackson/databind/deser/creators/CreatorWithRenamedParam4545Test.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public void testCreatorWithRename4545() throws Exception
5353
String jsonPayload = a2q("{ 'key1': 'val1', 'key2': 'val2'}");
5454

5555
try {
56-
MAPPER.readValue(jsonPayload, Payload4545.class);
56+
MAPPER.readerFor(Payload4545.class)
57+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
58+
.readValue(jsonPayload);
5759
fail("Should not pass");
5860
} catch (UnrecognizedPropertyException e) {
5961
verifyException(e, "Unrecognized");

src/test/java/tools/jackson/databind/deser/filter/IgnorePropertyOnDeserTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
88
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
99

10+
import tools.jackson.databind.DeserializationFeature;
1011
import tools.jackson.databind.ObjectMapper;
1112
import tools.jackson.databind.exc.UnrecognizedPropertyException;
1213

@@ -151,7 +152,9 @@ public void testIgnoreUnknownViaConfigOverride() throws Exception
151152

152153
// First, fail without overrides
153154
try {
154-
MAPPER.readValue(DOC, Point.class);
155+
MAPPER.readerFor(Point.class)
156+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
157+
.readValue(DOC);
155158
fail("Should not pass");
156159
} catch (UnrecognizedPropertyException e) {
157160
verifyException(e, "foobar"); // message varies between 2.x and 3.x

src/test/java/tools/jackson/databind/deser/filter/UnknownPropertyDeserTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ static class Bean987 {
162162
public void testUnknownHandlingDefault() throws Exception
163163
{
164164
try {
165-
MAPPER.readValue(JSON_UNKNOWN_FIELD, TestBean.class);
165+
MAPPER.readerFor(TestBean.class)
166+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
167+
.readValue(JSON_UNKNOWN_FIELD);
166168
fail("Should not pass");
167169
} catch (UnrecognizedPropertyException jex) {
168170
verifyException(jex, "Unrecognized property \"foo\"");

src/test/java/tools/jackson/databind/deser/jdk/VoidProperties2675Test.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ static class VoidBean {
2727
/**********************************************************************
2828
*/
2929

30-
private final ObjectMapper VOID_MAPPER = sharedMapper();
30+
private final ObjectMapper VOID_MAPPER = jsonMapperBuilder()
31+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
32+
.build();
3133

3234
private final ObjectMapper NO_VOID_MAPPER = jsonMapperBuilder()
3335
.disable(MapperFeature.ALLOW_VOID_VALUED_PROPERTIES)
36+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
3437
.build();
3538

3639
@Test

src/test/java/tools/jackson/databind/deser/merge/PropertyMergeTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ public void testBeanAsArrayMerging() throws Exception
226226
// and finally with extra, failing
227227
try {
228228
MAPPER.readerForUpdating(input)
229-
.readValue("[9, 8, 14]");
229+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
230+
.readValue("[9, 8, 14]");
230231
fail("Should not pass");
231232
} catch (MismatchedInputException e) {
232233
verifyException(e, "expected at most 2 properties");

src/test/java/tools/jackson/databind/exc/DeserExceptionTypeTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public void testHandlingOfUnrecognized() throws Exception
4848
{
4949
UnrecognizedPropertyException exc = null;
5050
try {
51-
MAPPER.readValue("{\"bar\":3}", Bean.class);
51+
MAPPER.readerFor(Bean.class)
52+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
53+
.readValue("{\"bar\":3}");
5254
} catch (UnrecognizedPropertyException e) {
5355
exc = e;
5456
}

src/test/java/tools/jackson/databind/introspect/AccessorNamingForBuilderTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public ValueClassXY build() {
4949
public void testAccessorCustomWithMethod() throws Exception
5050
{
5151
final String json = a2q("{'x':28,'y':72}");
52-
final ObjectMapper vanillaMapper = newJsonMapper();
52+
final ObjectMapper vanillaMapper = jsonMapperBuilder()
53+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
5354

5455
// First: without custom strategy, will fail:
5556
try {

src/test/java/tools/jackson/databind/introspect/TestInferredMutators.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.junit.jupiter.api.Test;
44

5+
import tools.jackson.databind.DeserializationFeature;
56
import tools.jackson.databind.MapperFeature;
67
import tools.jackson.databind.ObjectMapper;
78
import tools.jackson.databind.exc.UnrecognizedPropertyException;
@@ -35,6 +36,7 @@ public static class FixedPoint {
3536
public void testFinalFieldIgnoral() throws Exception
3637
{
3738
ObjectMapper mapper = jsonMapperBuilder()
39+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
3840
.disable(MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS)
3941
.build();
4042
try {
@@ -49,14 +51,15 @@ public void testFinalFieldIgnoral() throws Exception
4951
public void testDeserializationInference() throws Exception
5052
{
5153
final String JSON = "{\"x\":2}";
52-
ObjectMapper mapper = new ObjectMapper();
54+
ObjectMapper mapper = jsonMapperBuilder().enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
5355
// First: default case, inference enabled:
5456
assertTrue(mapper.isEnabled(MapperFeature.INFER_PROPERTY_MUTATORS));
5557
Point p = mapper.readValue(JSON, Point.class);
5658
assertEquals(2, p.x);
5759

5860
// but without it, should fail:
5961
mapper = jsonMapperBuilder()
62+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
6063
.disable(MapperFeature.INFER_PROPERTY_MUTATORS)
6164
.build();
6265
try {

src/test/java/tools/jackson/databind/introspect/TransientTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ public void testOverridingTransient() throws Exception
142142
public void testTransientToPrune() throws Exception
143143
{
144144
try {
145-
TransientToPrune result = MAPPER.readValue("{\"a\":3}",
146-
TransientToPrune.class);
145+
TransientToPrune result = MAPPER.readerFor(TransientToPrune.class)
146+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
147+
.readValue("{\"a\":3}");
147148
fail("Should not pass, got: "+result);
148149
} catch (UnrecognizedPropertyException e) {
149150
verifyException(e, "Unrecognized", "\"a\"");

src/test/java/tools/jackson/databind/jsontype/TestMultipleTypeNames.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.fasterxml.jackson.annotation.JsonSubTypes;
88
import com.fasterxml.jackson.annotation.JsonTypeInfo;
99

10+
import tools.jackson.databind.DeserializationFeature;
1011
import tools.jackson.databind.ObjectMapper;
1112
import tools.jackson.databind.exc.InvalidDefinitionException;
1213
import tools.jackson.databind.exc.UnrecognizedPropertyException;
@@ -17,7 +18,8 @@
1718
// Tests for [databind#2761] (and [annotations#171]
1819
public class TestMultipleTypeNames extends DatabindTestUtil
1920
{
20-
private final ObjectMapper MAPPER = newJsonMapper();
21+
private final ObjectMapper MAPPER = jsonMapperBuilder()
22+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
2123

2224
// common classes
2325
static class MultiTypeName { }
@@ -156,7 +158,9 @@ public void testNameAndNames() throws Exception
156158
// TC 2 : incorrect serialisation
157159
json = "{\"data\": [{\"type\":\"a\", \"data\": {\"x\": 2.2}}, {\"type\":\"b\", \"data\": {\"y\": 5.3}}, {\"type\":\"c\", \"data\": {\"y\": 9.8}}]}";
158160
try {
159-
MAPPER.readValue(json, WrapperForNameAndNamesTest.class);
161+
MAPPER.readerFor(WrapperForNameAndNamesTest.class)
162+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
163+
.readValue(json);
160164
fail("This serialisation should fail 'coz of x being float");
161165
} catch (UnrecognizedPropertyException e) {
162166
verifyException(e, "Unrecognized property \"data\"");

src/test/java/tools/jackson/databind/misc/CaseInsensitiveDeserTest.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public void testCaseInsensitiveDeserialization() throws Exception
133133
final String JSON = "{\"Value1\" : {\"nAme\" : \"fruit\", \"vALUe\" : \"apple\"}, \"valUE2\" : {\"NAME\" : \"color\", \"value\" : \"red\"}}";
134134

135135
// first, verify default settings which do not accept improper case
136-
ObjectMapper mapper = new ObjectMapper();
136+
ObjectMapper mapper = jsonMapperBuilder()
137+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
137138
assertFalse(mapper.isEnabled(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES));
138139
try {
139140
mapper.readValue(JSON, Issue476Bean.class);
@@ -233,8 +234,9 @@ public void testCaseInsensitiveViaClassAnnotation() throws Exception
233234

234235
// and finally, more complicated; should be possible to force sensitivity:
235236
try {
236-
/*CaseSensitiveRoleContainer r =*/ MAPPER.readValue(CONTAINED,
237-
CaseSensitiveRoleContainer.class);
237+
/*CaseSensitiveRoleContainer r =*/ jsonMapperBuilder()
238+
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build()
239+
.readValue(CONTAINED, CaseSensitiveRoleContainer.class);
238240
fail("Should not pass");
239241
} catch (UnrecognizedPropertyException e) {
240242
verifyException(e, "Unrecognized ");

src/test/java/tools/jackson/databind/module/SimpleModuleTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public void serialize(Test3787Bean value, JsonGenerator gen, SerializerProvider
211211
@Test
212212
public void testWithoutModule()
213213
{
214-
ObjectMapper mapper = new ObjectMapper();
214+
ObjectMapper mapper = jsonMapperBuilder().enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).build();
215215
// first: serialization failure:
216216
try {
217217
mapper.writeValueAsString(new CustomBean("foo", 3));

src/test/java/tools/jackson/databind/seq/ReadRecoveryTest.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ static class Bean {
3232
public void testRootBeans() throws Exception
3333
{
3434
final String JSON = a2q("{'a':3} {'x':5}");
35-
MappingIterator<Bean> it = MAPPER.readerFor(Bean.class).readValues(JSON);
35+
MappingIterator<Bean> it = MAPPER.readerFor(Bean.class)
36+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
37+
.readValues(JSON);
3638
// First one should be fine
3739
assertTrue(it.hasNextValue());
3840
Bean bean = it.nextValue();
@@ -58,7 +60,9 @@ public void testSimpleRootRecovery() throws Exception
5860
{
5961
final String JSON = a2q("{'a':3}{'a':27,'foo':[1,2],'b':{'x':3}} {'a':1,'b':2} ");
6062

61-
MappingIterator<Bean> it = MAPPER.readerFor(Bean.class).readValues(JSON);
63+
MappingIterator<Bean> it = MAPPER.readerFor(Bean.class)
64+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
65+
.readValues(JSON);
6266
Bean bean = it.nextValue();
6367

6468
assertNotNull(bean);
@@ -88,7 +92,9 @@ public void testSimpleArrayRecovery() throws Exception
8892
{
8993
final String JSON = a2q("[{'a':3},{'a':27,'foo':[1,2],'b':{'x':3}} ,{'a':1,'b':2} ]");
9094

91-
MappingIterator<Bean> it = MAPPER.readerFor(Bean.class).readValues(JSON);
95+
MappingIterator<Bean> it = MAPPER.readerFor(Bean.class)
96+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
97+
.readValues(JSON);
9298
Bean bean = it.nextValue();
9399

94100
assertNotNull(bean);

src/test/java/tools/jackson/databind/struct/TestPOJOAsArray.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ public void testUnknownExtraProp() throws Exception
295295
{
296296
String json = "{\"value\":[true,\"Foobar\",42,13, false]}";
297297
try {
298-
MAPPER.readValue(json, PojoAsArrayWrapper.class);
298+
MAPPER.readerFor(PojoAsArrayWrapper.class)
299+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
300+
.readValue(json);
299301
fail("should not pass with extra element");
300302
} catch (MismatchedInputException e) {
301303
verifyException(e, "Unexpected JSON values");

src/test/java/tools/jackson/databind/struct/TestPOJOAsArrayWithBuilder.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ public void testUnknownExtraProp() throws Exception
195195
{
196196
String json = "[1, 2, 3, 4]";
197197
try {
198-
MAPPER.readValue(json, ValueClassXY.class);
198+
MAPPER.readerFor(ValueClassXY.class)
199+
.with(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
200+
.readValue(json);
199201
fail("should not pass with extra element");
200202
} catch (MismatchedInputException e) {
201203
verifyException(e, "Unexpected JSON values");

0 commit comments

Comments
 (0)