Case-insensitive JsonNode in Jackson

前端 未结 2 591
栀梦
栀梦 2021-01-19 14:39

I need to deserialize JSON objects and access the fields in a case-insensitive manner. Example:

String s = \"{\\\"FOO\\\": 123}\";
ObjectMapper mapper = new         


        
2条回答
  •  春和景丽
    2021-01-19 15:20

    There is no automated way, but you could do it by creating custom JsonNodeFactory which creates custom ObjectNodes -- and then you can override method(s) used for adding and accessing entries.

提交回复
热议问题