Tales from support: JSON code folding

Someone who set “Recommend: yes” and “Overall quality: 1” (best) on the survey form sent the additional following feedback:

Code folding for JSON file does not work for situations like: “RaceCar”: { “Domestic”: true, “Model”: [] }

Unfortunately, the user did not provide an email address so I couldn’t get in contact with her/him. So what is the JSON editor doing with JSON data like this in terms of code folding? The sample data is all in one line. There is actually no chance for the editor to show code folding for JSON content that spans over a single line.

Use JSON pretty-print to show code folding

However, if you are using JSONBuddy as your JSON editor you also get a very useful pretty-print functionality that can be quickly executed by just pressing Ctrl-Shift-P. The sample JSON is immediately formatted in the following way:

Formatting JSON with pretty-print in JSONBuddy
Formatting JSON with pretty-print in JSONBuddy

As you can see, folding is available after the JSON data is formatted in the editor. It is also convenient that the current selection is also preserved after the pretty-print operation is completed. Maybe a small but important detail to provide the best JSON editor experience possible.

JSON schema editor: Full support for draft 6

JSONBuddy continues to extend the support for JSON schema and fully supports draft 6 as the only available JSON schema editor. From now on (JSONBuddy 4.6), you can validate your JSON files against draft 6 directly in the editor. In addition, you can also start using draft 6 in the command-line tool, which is part of the JSONBuddy software package, to run your batch validation tasks.

JSON schema draft 6 is supported by the following components in detail

  • JSON validator – Also available for background validation and live error indicators in text view
  • JSON schema editor – Full entry-helper support for new draft 6 keywords, schema validation and schema specification as help text.
  • JSON schema analyzer – Support for draft 6 schema keywords.

With JSON schema draft 6 and the integrated easy access to the schemastore.org schema library, JSONBuddy provides the most comprehensive support for JSON schema available. And JSONBuddy will also continue to implement the latest versions of the JSON schema standard in the future.