-
Notifications
You must be signed in to change notification settings - Fork 547
Open
Labels
bugSomething isn't workingSomething isn't working
Description
问题描述
PrettyFormat error
环境信息
请填写以下信息:
- OS信息: macOS 15.0
- JDK信息: Zulu21.34+19-CA (build 21.0.3+9-LTS)
- 版本信息:Fastjson2 2.0.53
重现步骤
record Person (String name) {}
public static void main(String[] args) throws JSONException {
var p = new Person("foo");
System.out.println(JSON.toJSONString(p, JSONWriter.Feature.PrettyFormat));
var jo = new JSONObject();
jo.put("name", "foo");
System.out.println(JSON.toJSONString(jo, JSONWriter.Feature.PrettyFormat));
}{
"name":"foo"
}
{
}期待的正确结果
{
"name":"foo"
}
{
"name":"foo"
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working