alibaba / alibaba/fastjson2

[QUESTION]JSON.parseObject后,map属性里的key首字母自动变成小写

Open
#1,610 2 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

{"busiProject":"customerPackage","paramMap":{"isScoreChanged":false,"BusinessType":"4","priorityScore":0.0},"taskId":"276063965","type":"ASSIGN"}

![image](https://github.com/alibaba/fastjson2/assets/4637107/ab32f448-6103-4ebd-b71c-b55c48d2b8ef)
![image](https://github.com/alibaba/fastjson2/assets/4637107/abd42fc2-4fa7-4100-8ecc-79f46281e251)

DispatchRequest对象里有Map paramMap 属性,然后上游那个string转对象后发现map里的 BusinessType这个key变成了businessType

我之前用的是2.0.32版本一直没有问题,昨天晚上上线时升级到了2.0.34,结果今天上午因为转换问题报了很多业务异常。将版本降回2.0.32后恢复了。

我在测试环境2.0.34也复现了这个问题,不过我本地没复现,更很奇的是我又将版本改回2.0.34测试环境也复现不了了,一脸懵逼,有没有什么思路

Contributor guide

Open the contributing guide

Research direction

Start with the supplied JSON and the DispatchRequest.paramMap case, comparing fastjson2 versions 2.0.32 and 2.0.34. Reproduce the reported conversion and inspect the Map deserialization path; done means determining whether BusinessType is preserved as written and identifying a stable regression case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.