RFC 9535 JSONPath in Go

March 29, 2026 ยท View on GitHub

โš–๏ธ MIT ๐Ÿ“š Docs ๐Ÿ—ƒ๏ธ Report Card ๐Ÿ› ๏ธ Build Status ๐Ÿ“Š Coverage

The jsonpath package provides RFC 9535 JSONPath functionality in Go. It operates on any type of slice or string-keyed map.

Learn More

JSONPath Expressions

A brief overview of RFC 9535 JSONPath syntax:

Syntax ElementDescription
$root node identifier
@current node identifier (valid only within filter selectors)
[<selectors>]child segment: selects zero or more children of a node
.nameshorthand for ['name']
.*shorthand for [*]
..[<selectors>]descendant segment: selects zero or more descendants of a node
..nameshorthand for ..['name']
..*shorthand for ..[*]
'name'name selector: selects a named child of an object
*wildcard selector: selects all children of a node
3index selector: selects an indexed child of an array (from 0)
0:100:5array slice selector: start:end:step for arrays
?<logical-expr>filter selector: selects particular children using a logical expression
length(@.foo)function extension: invokes a function in a filter expression

Dependencies

This package has only test dependencies.

Copyright ยฉ 2024-2025 David E. Wheeler