JSON Editor
The JSON Editor in DevKnife helps developers work with JSON quickly and comfortably, without relying on online tools. Paste or open a JSON file, format or minify it, and preview the result instantly.
Key Features
Section titled “Key Features”- Format or minify JSON – turn messy data into a nicely formatted structure, or compress it into a single line.
- Preview panel – see your JSON in a clean view while you edit.
- Search with JSON Query – filter and explore your data using JSON Query syntax (similar to JSONPath) to find exactly what you need.
JSON Query (JSONPath)
Section titled “JSON Query (JSONPath)”JSONPath is a query language for JSON, similar to XPath for XML. It lets you extract, filter, and navigate parts of a JSON document using concise expressions.
Basic Syntax
Section titled “Basic Syntax”$– the root element@– the current element.or[]– child operator (e.g.$.store.book)..– recursive descent (e.g.$..author)
Filters and Expressions
Section titled “Filters and Expressions”Filters allow you to select elements based on conditions using the ?() syntax. Inside the parentheses, you can use comparison operators such as <, >, ==, and != to build expressions.
Example:
$.store.book[?(@.price < 10)] – selects all books in the store with a price less than 10.
Wildcards
Section titled “Wildcards”The * wildcard matches all elements at a given level.
Example:
$.store.book[*].title – selects the title of every book in the store.
Slices
Section titled “Slices”Slices allow you to select a range of elements using the [start:end:step] syntax.
Examples:
$..book[0,1] – selects the first two books.
$..book[:2] – a shortcut that also selects the first two books.
You can type these queries in the JSON Query field below the preview panel to instantly filter and explore your data.
For a more in-depth tutorial on JSONPath, see the original article by Stefan Goessner.
Privacy
Section titled “Privacy”The JSON Editor in DevKnife works entirely offline on your Mac. No data ever leaves your computer, making it a secure choice when working with sensitive API responses, configuration files, or private datasets.