Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]2.0.51反序列化JSON字符串报unclosed.str错误 #3219

Open
vangt703 opened this issue Dec 24, 2024 · 0 comments
Open

[BUG]2.0.51反序列化JSON字符串报unclosed.str错误 #3219

vangt703 opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working fixed
Milestone

Comments

@vangt703
Copy link

问题描述

1.2.83序列化$ref的字符串,用2.0.51进行反序列化时,报unclosed.str错误

环境信息

  • OS信息: windows
  • JDK信息:jdk 1.8.0_431
  • 版本信息:Fastjson2 2.0.51

重现步骤

Map<String, Object> innerMap = new HashMap<>();
innerMap.put("xxx", "xxxx");
innerMap.put("ttt", "tttt");
Map<String, Object> map = new LinkedHashMap<>();
map.put("key1~", innerMap);
map.put("key2", innerMap);

String JSONStr = com.alibaba.fastjson.JSON.toJSONString(map);
Map map2 = com.alibaba.fastjson2.JSON.parseObject(JSONStr, Map.class);

map2里的key2值不正确,为{"$ref":"$.key1~"}

期待的正确结果

期望map2里key2的值为 {"xxx":"xxxx","ttt":"tttt"}

@vangt703 vangt703 added the bug Something isn't working label Dec 24, 2024
@wenshao wenshao added this to the 2.0.54 milestone Jan 1, 2025
@wenshao wenshao mentioned this issue Jan 1, 2025
3 tasks
@wenshao wenshao added the fixed label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants