8

Although the names look similar, small changes could be tricky. Unfortunately I cannot find decent info about JPath.

The docs of JSON.NET are talking about JPath and JSONPath and I think there are the same. Am I correct?

A String that contains a JPath expression.

from JToken.SelectToken (see also source code)

This sample loads JSON and then queries values from it using SelectToken(String) with a JSONPath query.

Which is using JObject.SelectToken (inherited from JToken)

from Querying JSON with JSONPath

Julian
  • 33,915
  • 22
  • 119
  • 174
  • 1
    Newtonsoft is talking about the same thing. The original article is [# JSONPath - XPath for JSON](http://goessner.net/articles/JsonPath/). In the context of [tag:json.net], the correct stackoverflow tag is [tag:jsonpath]. There might be some contexts other than Json.NET in which a [tag:jpath] might be correct, for instance https://github.com/stsvilik/jPath. – dbc Apr 23 '18 at 13:53

1 Answers1

5

I dived into this and found the issue.

  • In the namespace 'Newtonsoft.Json.Linq.JsonPath' there is also a class JPath, which is the implementation of the JSON expression. It's probably not called JsonPath as it will be an issue with the namespace.

So, the JPath is the implementing class for JSON Path and thus there are the same.

Update: created a PR for improving the documentation - and it's merged! :)

Julian
  • 33,915
  • 22
  • 119
  • 174