All notable changes to this project will be documented in this file. It uses the Keep a Changelog format, and this project adheres to Semantic Versioning.
- Added support for selecting values from any type of slice or string-keyed
map, not just
[]anyormap[string]any. Internally it still prefers[]anyandmap[string]any, to optimize for values decoded by encoding/json, but it now falls back on reflection to detect any other kind of slice or string-keyed map. Thanks to @ndsboy for the prompt (#26). - Updated result set creation to allocate more slots for results when the number of results are unknown, based on the number of selectors or items to select from, to improve memory efficiency. Encouraged by the recent Go blog post describing the advantages of this pattern.
- Upgraded to
golangci-lintv2.11.4 and made suggested slice allocation optimizations.
- Fixed some broken Go Doc links.
- Added some explicit slice size declarations to improve performance.
- Upgraded to
golangci-lintv2.10.1 - Added test coverage for Go v1.25 and v1.26
- Pulled the latest
jsonpath-compliance-test-suiteandregression_suite.yaml
- Removed unused constant from
parser/lex.go - Removed an unnecessary integer conversions reported as overflow risks by golangci-lint.
v0.10.2 — 2025-10-14
- Upgraded to
golangci-lintv2.5.0. - Removed unused constant from
parser/lex.go
- Fixed bug that prevented multiple blank-space delimited ANDed comparison
operations from being parsed. For example,
$[@.x=="hi"&&@.y!=3&&@[1]==1]would parse but$[@.x == "hi" && @.y !=3 && @[1]==1]would not. Thanks to @jarangutan for the bug report and @jg-rp for the analysis (#24).
v0.10.1 — 2025-09-16
- Allow
true,false, andnullto be used as selectors, e.g.,$.true.
- Upgraded to
golangci-lintv2.3.1. - Fixed test name scoping issues with testify objects.
- Upgraded the compliance test suite, now with tests using
true,false, andnullto be used as selectors.
v0.10.0 — 2025-07-11
- Added text and binary encoding interface methods to
Path:- encoding.TextMarshaler
- encoding.TextUnmarshaler
- encoding.BinaryMarshaler
- encoding.BinaryUnmarshaler Thanks to @rkosegi for the suggestion (#20)
- Upgraded to
golangci-lintv2.2.2.
v0.9.0 — 2025-05-05
- Significantly refactored the
specpackage toward greater stability, usability, and increased comprehensibility. The names of things are more consistent, the APIs more legible and user-friendly. Quite a few types were renamed or merged. - Added support for json.Number values to complement the existing support for Go core numeric types. This should allow for transparent handling of values marshaled with json.Decoder.UseNumber enabled.
- Moved the function extension types from the
registryto thespecpackage, simplifyingregistryand the handling of function extensions, without changing the interface for using a registry or adding extensions to it.
- Vastly expanded the
specpackage documentation to make it much more thorough and accurate, with copious links to relevant parts of RFC 9535 and complete lists of interface implementations and examples for each significant type. - Removed the "Package Stability" statement from the README, as all packages
are considered stable or else potentially unstable types in the
specpackage have been labeled as such. - Fixed links and typos in the main package documentation, and moved the
registry example under
WithRegistry. - Replaced the
spec.Wildcardvariable with a the functionspec.Wildcard().
- Upgraded the compliance test suite and integrated its located path test expectations. All tests passed, no changes required.
v0.4.1 — 2025-05-02
- Fixed the panic messages from
spec.Sliceto properly report coming fromSliceand notNewSlice.
- Upgraded to and fixed issues reported by
golangci-lintv2.1.5. - Added TinyGo testing on Go v1.24.
v0.4.0 — 2025-01-15
- Added the
Pointermethod toNormalizedPath. It returns an RFC 9535 JSON Pointer string representation of the normalized path.
v0.3.0 — 2024-12-28
- Added
SelectLocated. It works just likeSelect, but returnsLocatedNodes that pair the selected nodes with RFC 9535-definedNormalizedPaths that uniquely identify their locations within the JSON query argument. - Added
LocatedNodeList, the return value fromSelectLocated. It contains methods for working with the selected nodes, including iterators for its nodes &NormalizedPaths, deduplication, sorting, and cloning. - Added
ComparetoNormalizedPath, which enables the sorting ofLocatedNodeLists.
- Requires Go 1.23 to take advantage of its iterator support.
- Changed the return value of
Selectfrom[]anytoNodeList, which is an alias for[]any. Done to pair withLocatedNodeList, the return value ofSelectLocated. Features anAllmethod, which returns an iterator over all the nodes in the list. It may gain additional methods in the future.
- Added
Select,SelectLocated,NodeList, andLocatedNodeListexamples to the Go docs.
v0.2.1 — 2024-12-12
- Fixed the formatting of slice strings to omit min and max integers when not specified and using a negative step.
v0.2.0 — 2024-11-13
- Added
spec.Filter.Evalto allow public evaluation of a single JSON node. Used internally byspec.FilterSelector.Select. - Added
spec.Segment.IsDescendantto tell wether a segments selects just from the current child node or also recursively selects from all of its descendants.
- Added missing "?" to the stringification of
spec.FilterSelector.
- Made
spec.SliceSelector.Boundspublic. - Made the underlying struct defining
spec.Wildcardpublic, named itspec.WildcardSelector.
v0.1.2 — 2024-10-28
- Eliminated a lexer variable that prevented TinyGo compilation.
- Added simple tests to ensure the package compiles properly as Go and TinyGo WASM.
- Added the WASM compile test to the Test and Lint GitHub action.
- Fixed version header links here in CHANGELOG.md.
v0.1.1 — 2024-09-19
- Neatened the formatting of the README table for improved display on pkg.go.dev.
v0.1.0 — 2024-09-19
The theme of this release is Standards Matter.
- First release, everything is new!
- Full RFC 9535 JSONPath implementation
- All JSONPath Compliance Test Suite tests pass
- Includes parser, AST, and executor
- Built with Go
- Use
go getto add to a project
- Docs on pkg.go.dev
- Syntax summary in
README
- The
jsonpathpackage is stable and unlikely to change - The
specpackage is not yet stable - The
registrypackage is stable, althoughspecobjects it references may change - More detailed documentation to come