alibaba / alibaba/fastjson2

[QUESTION]从1.2.83升级到2.0.55之后JSONObject的toJavaObject()方法会把Map的value为null的键忽略掉怎么才能不忽略

Open
#3,355 8 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

### 请描述您的问题
*询问有关本项目的使用和其他方面的相关问题。*
从1.2.83升级到2.0.55之后JSONObject的toJavaObject()方法会把Map的value为null的键忽略掉怎么才能不忽略,代码里面没有显示的设置忽略value为null的键。1.2.83版本下是可以的,升级之后就不行了。是fastjson2的默认策略有变化吗?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported JSONObject.toJavaObject() behavior with a Map containing a null value, then compare the result between fastjson 1.2.83 and 2.0.55. Check whether the newer default strategy or an available option controls null-valued keys; done means the behavior and supported configuration are confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.