JSONPath is a query language for selecting nodes from JSON documents. It was first proposed by Stefan Gössner in 2007. OK JSON uses JSONPath Plus to perform queries under the hood.
{
"name": "OK JSON",
"version": "1.0",
"features": {
"format": "Format JSON in Pasteboard with keyboard shortcut.",
"view": "View JSON in tree view with beautiful syntax highlight.",
"edit": "Edit JSON with capable native editor."
},
"themes": [
"Candy",
"GitHub",
"Monokai",
"Dracula",
"Sunset",
"Ayu",
"DuoTone",
"Meadow",
"Raindrop",
"Visual Studio"
]
}
JSONPath expressions start with $.
indicating the root element.
$.features.format → "Format JSON in Pasteboard with keyboard shortcut."
$.features.* →
[
"Format JSON in Pasteboard with keyboard shortcut.",
"View JSON in tree view with beautiful syntax highlight.",
"Edit JSON with capable native editor."
]
# Second element in array
$.themes[1] → "Candy"
# Last element in array
$.themes[-1:] → "Visual Studio"
For a more detailed documentation of JSONPath, visit JSONPath Plus on GitHub.