JSON Editor¶
The JSON Editor provides a powerful environment for editing, validating, and querying JSON files with support for multiple JSON formats.
Version: 2.0.1
Note: The standalone JSON Editor tab has been retired. JSON editing — text editing plus the tree view and validation — now lives in the Unified Shell: open a
.jsonfile and the JSON editor view (text/tree) is available there. The capabilities below are unchanged; they are now part of the shell rather than a dedicated sidebar tab.
Overview¶
FreeXmlToolkit includes a full-featured JSON Editor that supports:
- Standard JSON - RFC 8259 compliant
- JSONC - JSON with Comments (single-line // and block /* */)
- JSON5 - Extended JSON with trailing commas, unquoted keys, and comments
JSON editing (text + tree view) in the Unified Shell
Features¶
Text Editor¶
| Feature | Description |
|---|---|
| Syntax Highlighting | Color-coded JSON for easy reading |
| Auto Format | Beautify JSON with proper indentation |
| Minify | Compress JSON by removing whitespace |
| Undo/Redo | Full undo/redo support |
| Line Numbers | Numbered lines for easy navigation |
| Drag & Drop | Drop JSON files directly into the editor |
Tree View¶
The tree view provides a hierarchical view of your JSON structure:
| Feature | Description |
|---|---|
| Interactive Navigation | Click on nodes to jump to that location in the text |
| Expand/Collapse | Expand or collapse nodes to focus on specific areas |
| Search | Search for keys or values within the tree |
| Sync with Editor | Synchronize selection between tree and text |
| Type Icons | Visual icons for objects, arrays, strings, numbers, booleans, and null |
Hover Information¶
When you hover over any element in the JSON editor, you'll see:
- JSONPath - The full path to the current element (e.g., $.store.book[0].title)
- Type - The JSON type (object, array, string, number, boolean, null)
- Key - The property key name
- Value - A preview of the value (truncated for long values)
JSONPath Queries¶
Execute JSONPath queries to extract data from your JSON documents:
| Query Example | Description |
|---|---|
$.store.book[*].author |
All authors in the store |
$..author |
All authors anywhere in the document |
$.store.book[?(@.price < 10)] |
Books cheaper than 10 |
$.store.book[0,1] |
First two books |
$.store.book[-1:] |
Last book |
To run a query: 1. Open the Query Console (terminal icon in the toolbar, or Ctrl+Shift+X) - with a JSON document active it evaluates JSONPath 2. Enter your JSONPath expression 3. Run it to see the results in the console's result pane
Validation¶
Syntax Validation¶
Click Validate to check if your JSON is syntactically correct. The editor will report: - Parse errors with line and column numbers - Detected format (JSON, JSONC, or JSON5)
JSON Schema Validation¶
JSON documents bind a JSON Schema the same way XML documents bind an XSD:
- Automatic: a top-level
"$schema"member pointing at a schema file or URL (e.g."$schema": "./product-schema.json") is detected when the file opens. Relative paths resolve against the document's folder;http(s)URLs are downloaded and cached. (Values pointing atjson-schema.orgmeta-schemas are dialect declarations, not bindings, and are ignored.) - Manual: click the JSON Schema indicator in the status bar, use the
JSON Schema source row in the Validation panel (Change link, favorites
star, or drag & drop a
.jsonschema onto the row or the status bar).
Validation runs via Run Validation in the panel, the toolbar's Validate button / F8, or continuously while typing (Validate while typing, on by default). Schema violations appear in the PROBLEMS list with the offending line number — clicking a problem jumps to it. Each problem also carries the failing schema keyword and the JSON pointer of the invalid value.
The validator supports JSON Schema Draft-07, 2019-09, and 2020-12;
the dialect is selected by the schema's own $schema declaration (2020-12 is
the default for schemas without one). Relative $refs between schema files
resolve as expected.
Ready-made examples
The examples/json/ folder shipped with the application contains a complete
demo set: a product-catalog schema with a relative $ref, a valid and a
deliberately invalid instance (six line-navigable violations), and one
dialect demo each for Draft-07 and 2019-09. Open
examples/json/products-invalid.json and press F8 to see it in action.
Keyboard Shortcuts¶
| Shortcut | Action |
|---|---|
Ctrl+N |
New JSON file |
Ctrl+O |
Open file |
Ctrl+S |
Save file |
Ctrl+Shift+S |
Save as |
Ctrl+Alt+F |
Format JSON |
F8 |
Validate JSON |
Ctrl+Z |
Undo |
Ctrl+Y |
Redo |
Ctrl++ |
Zoom in |
Ctrl+- |
Zoom out |
Ctrl+0 |
Reset zoom |
Supported Formats¶
JSON (Standard)¶
JSONC (JSON with Comments)¶
JSON5¶
{
// Unquoted keys
name: 'John',
// Single quotes
city: 'New York',
// Trailing commas allowed
items: [1, 2, 3,],
}
Toolbar¶
JSON files use the shell's single-row editor toolbar. Related actions sit in split buttons with a visible ▾ arrow menu; see Unified Shell - Toolbar for the full reference.
With a JSON file active, the relevant actions are:
| Button | Description |
|---|---|
| New | Open the guided New File dialog (includes JSON) |
| Open | Open an existing file |
| Save ▾ | Save the current document; the arrow menu holds Save As… and Save All |
| Undo / Redo | Undo or redo changes (icon buttons) |
| Format ▾ | Pretty-print the JSON; the arrow menu holds Minify (compress by removing whitespace) |
| Query Console | Toggle the bottom query console - for JSON documents it runs JSONPath queries (icon button, Ctrl+Shift+X) |
| Validate | Check the JSON syntax (F8) |
Actions that do not apply to JSON (e.g. Run or the XSLT transform) are greyed out. The Tree view is switched with the Text/Tree view switch at the right end of the toolbar.
Tree View Icons¶
| Icon | Type |
|---|---|
{ } |
Object (blue) |
[ ] |
Array (green) |
" " |
String (gray) |
# |
Number (orange) |
| Toggle | Boolean (cyan) |
- |
Null (gray, italic) |
// |
Comment (green, italic) |
Tips and Best Practices¶
- Use the Tree View for navigating large JSON documents
- Enable Auto-Format after pasting JSON from external sources
- Use JSONPath to quickly extract specific data
- Validate against Schema to ensure data quality
- Drag and Drop files for quick access
Related¶
- XML Editor - Edit XML files with similar features
- XSLT Developer - Transform JSON to other formats
Navigation¶
| Previous | Home | Next |
|---|---|---|
| Schematron | Home | XML Editor |
All Pages: Unified Shell | XML Editor | XML Features | JSON Editor | XSD Tools | Profiled XML Generation | XSD Validation | XSLT Viewer | XSLT Developer | FOP/PDF | Signatures | IntelliSense | Schematron | FundsXML Extensions | Favorites | Templates | Tech Stack | Security | Licenses