Pretty-printing a compact object
- Input
- Text = {"name":"Amina","tags":["api","json"],"active":true}, Indent = 2 spaces
- Working
- The value is parsed, then serialised again with two spaces per nesting level: nested arrays and objects open onto their own lines, and the key order (name, tags, active) is kept exactly as written.
- Result
- { "name": "Amina", "tags": [ "api", "json" ], "active": true }