Questions tagged [jpath]

JSONPath expressions always refer to a JSON structure in the same way as XPath expression are used in combination with an XML document. Since a JSON structure is usually anonymous and doesn't necessarily have a "root member object" JSONPath assumes the abstract name $ assigned to the outer level object. JSONPath expressions can use the dot–notation $.store.book[0].title or the bracket–notation $['store']['book'][0]['title']

17 questions
23
votes
1 answer

JSON.NET JObject - how do I get value from this nested JSON structure

I have this JSON: { "client_id": "26075235", "client_version": "1.0.0", "event": "app.uninstall", "timestamp": 1478741247, "data": { "user_id": "62581379", "site_id": "837771289247593785", …
Chris Halcrow
  • 21,541
  • 11
  • 115
  • 145
6
votes
1 answer

Is JPath the same as JSONPath in JSON.NET?

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…
Julian
  • 26,655
  • 14
  • 92
  • 132
2
votes
0 answers

Fetching an Array inside JsonArray for JSON PATH

My JsonBody is { "acr_values":[ "AAL1", "AAL2" ], "poc":[ { "attribute1":"value1" }, { "attribute1":"value2" } ] } I'm trying to fetch the attribute acr_values as Array,…
krishviews
  • 31
  • 2
2
votes
0 answers

Does Json.net support more complicated wildcard searches with SelectTokens()?

I know that I can do a wildcard search like this: jObject.SelectTokens("items.*.name"); I build the search path at runtime, its not hardcoded. In certain cases, I need to do a search for something a bit more complex like "q*", so that would result…
SledgeHammer
  • 6,482
  • 4
  • 23
  • 58
2
votes
0 answers

Json Path Expression to Convert array to string

I was trying to find a way to convert the json array to json string. http://jsonpath.com/ JSON { "firstName": "John", "lastName" : "doe", "age" : 26, "address" : { "streetAddress": "naist street", "city" : "Nara", …
devanathan
  • 603
  • 2
  • 8
  • 34
1
vote
1 answer

What is jpath for {"Type":"Ping"} in Json.Net?

I have a simple string from webSockets. And i stuck on jPath for SelectTokens() method. Is there any path which can help me grab $.Type only if it is equal to 'Ping'? var str= @"{""Type"":""Ping""}"; var token =…
Trinitron
  • 178
  • 8
1
vote
1 answer

JSON Path - How to find the root elements based on child elements?

I have a JSON object, and I'm trying to find the root elements under it. Can someone please help me to figure this out? { "store" : { "10162021" : { "id" : 812340, "properties" : { "server" :…
rshdzrt
  • 55
  • 7
1
vote
1 answer

I need to get the primitive data type from json path using in-definite path

Given this document: { "slide": [{ "title": { "fontName": "Open Sans", "top": 188, "left": -22, "width": 597, "fontSize": 45, "valign": "bottom", …
Santhosh Tpixler
  • 161
  • 1
  • 10
0
votes
1 answer

Get Values form Json, using jpath

{ "data": [ { "id": "52fb62dc-a446-4fbb-9c7e-e75d8c90f6d9", "name": "abx", "address": { "address1": "New Address 1", "address2": "New Address 2", "Pin":"800001" …
Sai
  • 3
  • 2
0
votes
1 answer

Dynamically Generate the JSON Schema from the JSON file in JAVA without using the POJO

Any suggestions for getting the JPATH's for the input JSON file. Basically a tree structure of the JSON schema from the JSON file
Sandeep Shetty
  • 147
  • 1
  • 9
0
votes
0 answers

Escaping single quote in Jpath

I have a well formatted json like below: { "Slide":[ { "Code": "'!!!", "Status": "OK" }, { "Code": "123", "Status": "Failed" } ] } I use json path to filter…
SKN
  • 488
  • 1
  • 4
  • 17
0
votes
4 answers

Get the path of a key from nested JSON using Json.Net

I have a big nested JSON. I don't know the structure of the JSON. I just have a set of keys which are present in the JSON but I don't know where exactly in the JSON. How do I find out the path of a key from an unknown JSON structure assuming the key…
0
votes
0 answers

Is there a XPath with schema equivilent for JSON?

Is there a library that provides a way to query JSON that is similar to XPath with a schema? I say with a Schema because we want typed queries both for the filtering (inequalities on dates) and the returned values. We need this on Java and would…
David Thielen
  • 22,779
  • 27
  • 83
  • 163
0
votes
1 answer

JsonPath with JsonTextReader: Token at a Time

I am having an issue with JsonPath working differently when loading token (.Load) at a time using JsonTextReader versus loading the entire JSON using ReadFrom. Here is an example: JSON: Path="[*].person" Method=SelectTokens(path) [ { …
Steven Mayer
  • 561
  • 1
  • 5
  • 18
-1
votes
0 answers

Need help to find a way to edit JSON nested values

I am looking to solve a specific issue on updating a value in JSON. There are two problems I am facing when trying to update QueueName in the following JSON { "AWSTemplateFormatVersion": "2010-09-09", "Resources": { …
1
2