Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

解析重复属性节点未报异常 #4520

Open
jingchuyin1 opened this issue Jul 22, 2024 · 2 comments
Open

解析重复属性节点未报异常 #4520

jingchuyin1 opened this issue Jul 22, 2024 · 2 comments

Comments

@jingchuyin1
Copy link

fastjson:1.2.83
环境:windows11

现象:
错误的json(如下截图),通过json转换实体对象,未报异常,代码如下:
Page page = JSON.parseObject(content, Page.class);
entities.add(page);
但在linux下会报错:com.alibaba.fastjson.JSONException: syntax error, string
image

@jingchuyin1 jingchuyin1 changed the title 解析数组节点一场 解析数组节点异常 Jul 22, 2024
@jingchuyin1
Copy link
Author

如下是补充的案例,这是很简单的一个json,有两个重复节点的如下:
JSON体:
{
"pageName":""
"pageName":"123",
"pageDsl": "123"
}

Page类:
@DaTa
public class Page {
private String pageName;
private String pageDsl;
}

测试函数:
Page page = JSON.parseObject(content, Page.class);

@jingchuyin1 jingchuyin1 changed the title 解析数组节点异常 解析重复属性节点未报异常 Jul 22, 2024
@jingchuyin1
Copy link
Author

同样的gson会报错异常:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant