JSON Path (RFC 9535) built on the System.Text.Json namespace
$ dotnet add package JsonPath.NetJsonPath.Net implements the JSON Path specification RFC 9535, a string syntax for selecting and extracting JSON values from within a given JSON value.
var path = JsonPath.Parse("$.prop[0:6:2]");
var instance = JsonNode.Parse("{\"prop\":[0,1,2,3]}");
var results = path.Evaluate(instance);
/*
results:
[
{
"Value": 0,
"Location": "$['prop'][0]"
},
{
"Value": 2,
"Location": "$['prop'][2]"
}
]
*/
If you found this library helpful and would like to promote continued development, please consider sponsoring the maintainers.