Questions tagged [jsonpath]

JSONPath is a means of using XPath-like syntax to query JSON structures. Not to be confused with rest-assured's JsonPath implementation based on Groovy's Gpath. Use the [json-path-expression] tag for questions about JSON path expressions in general and for questions about JSON path expression DSLs.

JSONPath is a means of using XPath-like syntax to query JSON structures.

It is not a standard, but it does offer a means of querying JavaScript structures directly without needing to convert to or from XML.
JSONPath expressions always refer to a JSON structure in the same way as XPath expression are used in combination with an XML document.

Implementations:

Not to be confused with the standard of the same name by rest-assured: https://github.com/rest-assured/rest-assured/wiki/Usage#json-using-jsonpath

1786 questions
0
votes
1 answer

How do we add an element to JSON string using Json path?

I have a use case where i will initially have a JSON object with few elements and I want to add few more new elements to this object using JSON path with the help of Javascript. Eg: JSON object: { "article": { "title": "Article Title", …
PRAI
  • 1
0
votes
1 answer

Search type JSONPath

I use JSONpath but despite my research I don't find some response. Look at one exemple of my object "definitions" : { "person" : { "properties" : { "person_id" : { "format" : "int32", "type" : "integer" …
Ant3xes
  • 51
  • 8
0
votes
1 answer

Is it possible to use JSONPath or XPath to get a query string?

I'm currently using Insomnia App to create some requests and one of my API responses I get a JSON with "redirect_uri" field and the value is actually a URL. I need to get only the code parameter, so the JSONPath or XPath needs to return…
Bart
  • 251
  • 4
  • 10
0
votes
1 answer

Jayway JsonPath query to get required json format

I need to extract a json in required format from input json. i'm using jayway json path library. How to achieve it ? Input Json: { "ccid": [ { "id": 13, "src": { …
user3383301
  • 1,891
  • 3
  • 21
  • 49
0
votes
1 answer

How to match json path in Hoverfly matching strategy?

The jsonPath matching in hoverfly simulation file is "body" : [ { "matcher" : "jsonpath", "value" : "$[0].langId" } The above does not seem to work for the following request "Body": "[{\"langId\":\"en\",\"fallback\":\"true\"}]" Is this an issue ?…
CVA
  • 1,477
  • 1
  • 14
  • 23
0
votes
1 answer

Getting Could not compile inline filter :

I was trying to get json array using query with json path I used following maven repo I used com.jayway.jsonpath version 2.4.0 from maven Json Is : { "verdict": [ { "firstSeenOn": "2015-01-21T07:56:00.000+0000", …
indrajit narvekar
  • 143
  • 1
  • 6
  • 18
0
votes
1 answer

how to read multiple levels of JSON data in Big Query using JSON_EXTRACT or JSON_EXTRACT_SCALAR

I am trying to read the below JSON structure in Bigquery using JSON_EXTRACT in Bigquery ..it says unsupported operator Path "*" Tried all the ways I can in BigQuery and Request your help Error: Unsupported operator in JSONPath: * ****JSON data:**…
Nanda
  • 159
  • 1
  • 13
0
votes
1 answer

JSON Path seems to be removing a comma

I'm using JSON Path to extract a some data from a json object. The object looks like this: { "properties": { "random_field": "abc", "max value": "£35,900" } } My JSON path looks like this: insert into display_paths…
nimgwfc
  • 1,294
  • 1
  • 12
  • 30
0
votes
1 answer

Json-path json extractor that consist from nodes with fullstop in their names

I use com.jayway.jsonpath:json-path for quick accessing and modifying nodes. Example of pattern is: "$.dnode.meta" helps to manage data on meta node level that located inside of dnode. Example of json is: { "dnode": { "meta": "some value" …
Sergii
  • 7,044
  • 14
  • 58
  • 116
0
votes
1 answer

Issue with Java json-path library

all. I'm having a really strange issue with https://github.com/json-path/JsonPath One of the issues seems to be a re-entrant issue that the implentation has: when executing a path, each piece returns a string: Expected to find an object with…
gaspo53
  • 103
  • 2
  • 9
0
votes
1 answer

JsonPath that combines fields from a complex object

I am using jsonpath_rw_ext for python currently I am unable to come up with a path string that returns the fields I want without getting errors. I think I can get most of what I'm describing as individual fields however I can't put then…
Jeff Saremi
  • 2,674
  • 3
  • 33
  • 57
0
votes
0 answers

How to query JSON with wildcards and modify the results?

I'd like to be able to query a JSON object and modify it in a way that is structure-agnostic and doesn't involve marshalling to POJOs. Here's an example to illustrate. { "user" : [ { "username" : "foo", "user-id" : "1234", "name" : { …
Sabrina Star
  • 1
  • 1
  • 1
0
votes
1 answer

Conditional transformation from jsonpath to jsonpath

We are trying to transform a JsonPath to a different jsonpath as below: Request: { "name" : "Required", "address[0]" : "Required", "address[0].city" : "Optional", "address[0].country" : "Required" "address[1]" : "Required", "address[1].city"…
Arun
  • 1
  • 1
0
votes
1 answer

Karate API framework is there any way to iterate through the child values

I am getting 90 cent success with my approach but when the response has got multiple entries in one of the child key then the logic gets failed and I am not able to put one common logic in place which would run for all the cases. The response…
vdrulerz
  • 264
  • 3
  • 13
0
votes
1 answer

Extract an element value in json using jsonpath

Following is my json data { "primary": [ { "secondary": { "name": { "fullname": "fullname1" }, "alias": "alias1" }, "reference":…