Skip to content

PRETTY_PRINT_OUTPUT with composer doesn't work #38

Closed
@weizhu-us

Description

@weizhu-us

PRETTY_PRINT_OUTPUT with composer doesn't work. I tried both 2.7.1 and 2.5. It doesn't do the pretty print
code:

 String json = JSON.std
                    .with(JSON.Feature.PRETTY_PRINT_OUTPUT)
                    .composeString()
                    .startObject()
                    .put("a", 1)
                    .startArrayField("arr")
                    .add(1).add(2).add(3)
                    .end()
                    .startObjectField("ob")
                    .put("x", 3)
                    .put("y", 4)
                    .startArrayField("args").add("none").end()
                    .end()
                    .put("last", true)
                    .end()
                    .finish();
 System.out.println(json);

Output:
{"a":1,"arr":[1,2,3],"ob":{"x":3,"y":4,"args":["none"]},"last":true}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions