GitHub - theory/jsonpath: RFC 9535 JSONPath in Go (original) (raw)

Skip to content

View all features

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

RFC 9535 JSONPath in Go

βš–οΈ MIT πŸ“š Docs πŸ—ƒοΈ Report Card πŸ› οΈ Build Status πŸ“Š Coverage

The jsonpath package provides RFC 9535 JSONPath functionality in Go.

Learn More

JSONPath Expressions

A brief overview of RFC 9535 JSONPath syntax:

Syntax Element Description
$ root node identifier
@ current node identifier (valid only within filter selectors)
[] child segment: selects zero or more children of a node
.name shorthand for ['name']
.* shorthand for [*]
..[] descendant segment: selects zero or more descendants of a node
..name shorthand for ..['name']
..* shorthand for ..[*]
'name' name selector: selects a named child of an object
* wildcard selector: selects all children of a node
3 index selector: selects an indexed child of an array (from 0)
0πŸ’―5 array slice selector: startπŸ”šstep for arrays
? filter selector: selects particular children using a logical expression
length(@.foo) function extension: invokes a function in a filter expression

Dependencies

This package has no runtime dependencies, only testing dependencies.

Copyright Β© 2024-2025 David E. Wheeler