Skip to content

Pretty-print the JSON in the config file #1

@apjanke

Description

@apjanke

From James Hong at MathWorks Tech Support:

uglyJson = jsonencode(struct('a',1:10,'b','hello'));
gson = com.google.gson.GsonBuilder;
gson = gson.setPrettyPrinting().create();
jp = com.google.gson.JsonParser;
je = jp.parse(uglyJson);
prettyJsonString = gson.toJson(je)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions