首页 > 其他分享 >Jackson 的 DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES

Jackson 的 DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES

时间:2023-02-04 06:55:05浏览次数:51  
标签:Jackson setter 抛出 UNKNOWN FAIL DeserializationFeature 序列化 属性

API 文档中的说法就是:

Feature that determines whether encountering of unknown properties (ones that do not map to a property, and there is no “any setter” or handler that can handle it) should result in a failure

 

2023-02-03_16-20-40

 

反序列化时遇到未知属性(那些没有对应的属性来映射的属性,并且没有任何setter或handler来处理这样的属性)是否抛出处理失败的异常。

说明

简单来说,就是在进行序列化或者反序列化的时候。

JSON 字符串中有一个字段,但是我们的对象没有这个字段,那么处理器应该做什么的配置。

默认情况下是抛出异常,如果不想抛出异常只想处理继续进行的话,这个参数要设置为 False。

 

https://www.ossez.com/t/jackson-deserializationfeature-fail-on-unknown-properties/14311

标签:Jackson,setter,抛出,UNKNOWN,FAIL,DeserializationFeature,序列化,属性
From: https://www.cnblogs.com/huyuchengus/p/17090817.html

相关文章