alibaba / alibaba/fastjson2

[BUG] json转换异常

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

Description

### 问题描述
*简要描述您碰到的问题。*
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: int overflow, value 45130000002000000001; nested exception is com.alibaba.fastjson2.JSONException: int overflow, value 45130000002000000001

### 环境信息
*请填写以下信息:*

- OS信息: [e.g.:Windows 10 企业版 LTSC 21H2, Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz 2.81 GHz 32GB]
- JDK信息: [e.g.:eclipse Temurin version 1.8.0_362]
- 版本信息:[e.g.:Fastjson2 2.0.17]

### 重现步骤
*如何操作可以重现该问题:*

1. 使用 `xxx.xxx` 方法
2. 输入 `...` 数据
3. 出现 `...` 错误
```java
//可在此输入示例代码
{"id":null,"enable":true,"ptz":true,"rtcp":false,"asMessageChannel":false,"name":"45130000002000000001","serverGBId":"45130000002000000001","serverGBDomain":"4513000002","serverIP":"192.168.4.64","serverPort":"45130000002000000001","deviceGBId":"41010500002000000001","deviceIp":"172.16.30.140","devicePort":8116,"username":"41010500002000000001","password":"123#@!qwe","expires":3600,"keepTimeout":60,"transport":"UDP","characterSet":"GB2312","startOfflinePush":false,"catalogGroup":1,"administrativeDivision":"410105"}
```

### 期待的正确结果
*对您期望发生的结果进行清晰简洁的描述。*

### 相关日志输出
*请复制并粘贴任何相关的日志输出。*

#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported org.springframework.http.converter.HttpMessageNotReadableException with the JSON sample and inspect Fastjson2's deserialization of the long numeric-looking string values. Confirm the intended field types and expected handling of the 20-digit identifiers, then capture the confirmed behavior in regression coverage.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.