Skip to content

[BUG]JSON.parseArray("[{[]}]")不报错 #1058

Closed
@fourangrymen

Description

问题描述

我并不十分确定这是一个bug

环境信息

  • 版本信息:[Fastjson2 2.0.22]

重现步骤

System.out.println(JSON.parseArray("[{[]}]"));
输出:
[{"":[]}]

System.out.println(JSON.parseObject("{[]}"));
报错:
Exception in thread "main" com.alibaba.fastjson2.JSONException: not allow unquoted fieldName, offset 2, character [, line 1, column 3, fastjson-version 2.0.22 {[]}

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions