[BUG]JSON.isValid(String text)校验带数字的json字符串结果错误
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
### 问题描述
*JSON.isValid(String text)校验带数字的json字符串结果错误*
### 环境信息
*请填写以下信息:*
- OS信息: [Windows 10 家庭中文版 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 GHz]
- JDK信息: [java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)]
- 版本信息:[Fastjson2 2.0.32]
### 重现步骤
*如何操作可以重现该问题:*
1. 使用 `JSON.isValid(String text)` 方法
2. 输入 `"{\n\"name\": \"张三\",\n\"age\": 18\n}"` 数据
3. 出现 `返回结果:false` 错误
```java
public static void main(String[] args) {
System.out.println(JSON.isValid("{\n\"name\": \"张三\",\n\"age\": 18\n}"));
}
```
### 期待的正确结果
*期望返回:true*
Contributor guide
Research direction
Start at the JSON.isValid(String text) entry point and reproduce the reported result with the supplied Java example containing the numeric age value. Add or run a regression test for this input and verify that valid JSON with a number returns true.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100