JPath是否与JSON.NET中的JSONPath相同? [英] Is JPath the same as JSONPath in JSON.NET?

查看:83
本文介绍了JPath是否与JSON.NET中的JSONPath相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管名称看起来很相似,但细微的改动可能会有些棘手.不幸的是,我找不到有关JPath的体面信息.

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

JSON.NET的文档正在谈论JPath和JSONPath,我认为它们是相同的.我对么?

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

包含JPath表达式的字符串.

A String that contains a JPath expression.

来自 JToken.SelectToken (另请参见源代码)

此示例加载JSON,然后使用SelectToken(String)和JSONPath查询从中查询值.

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

使用的是 JObject.SelectToken (从 JToken 继承)

来自使用JSONPath查询JSON

推荐答案

我深入研究并发现了问题.

I dived into this and found the issue.

  • 在命名空间"Newtonsoft.Json.Linq.JsonPath"中,还有一个类 JPath ,它是JSON表达式的实现.它可能不称为JsonPath,因为它将是名称空间的问题.
  • 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.

因此, JPath 是JSON Path的实现类,因此存在相同的地方.

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

旁注:为此创建了一个 PR -并且已合并!:)

Side note: created a PR for this - and it's merged! :)

这篇关于JPath是否与JSON.NET中的JSONPath相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆