Editing JSON files with the JSON editor

You can use the JSON text editor to easily modify, format, and validate your JSON files.

About this task

The JSON editor offers the following features:
  • Syntax highlighting
  • Range indication
  • Source compression and formatting
  • Code folding
  • Bracket matching
  • Syntax validation
  • Outline view

Procedure

  1. In the Enterprise Explorer view, right-click your .json file or other file type that contains JSON code and select Open With > JSON Editor.
  2. You can compress JSON strings so that the strings display on one line with white space removed between JSON elements. To compress JSON strings, right-click the editor and select Source > Compress from the menu or press CTRL + Shift + G. The white space between elements is removed.
    compressed JSON file
  3. To format the content so that it is more readable, right-click the editor and select Source > Format from the menu or press Ctrl + Shift + F. The content is wrapped and each object is placed on its own line.
    Formatted JSON file
  4. You can use the visual indicators that are shown in the vertical ruler to expand or collapse a corresponding region in the editor. For example, you can expand or collapse structural elements of objects and arrays that span more than one line. To format large amounts of content, click an indicator to toggle the expanded or collapsed state of the corresponding region in the editor.
  5. To collapse all regions, right-click the vertical ruler and select Folding > Collapse All. All regions are hidden in the editor.
  6. To expand all regions, right-click the vertical ruler and select Folding > Expand All. All regions are shown in the editor.
  7. Save your changes.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tjsonedit.html