Questions tagged [json-path-expression]

A JSON path expression is an expression, possibly in a domain-specific language, specifying a path to to one or more values within a JSON text. The expression may include filters.

Javascript provides a well-known notation for JSON path expressions. JSONPath and JMSEPath are well-known DSLs for JSON path expressions. In jq, any JSON array consisting solely of strings and/or integers can be used as a path expression.

179 questions
0
votes
1 answer

Jmeter - How to get nested object in json with multiple object

I have this json: { "deviceId": "deviceCustom", "moduleId": "custom", "properties": { "desired": { "settings": { "ef78c18c-2291-4d15-ae87-d89abb9b1fef": { "name": "elements", …
sarjaana
  • 77
  • 1
  • 1
  • 6
0
votes
1 answer

Goessner JSON Query Syntax and Filtering

Looking to filter this json body for specific key/values for when a certain condition is met. For this body - I'd like to retrieve ONLY the recipient ID and Tracking Number for when the requester ID is 67890. { "metadata": "someinformation", …
0
votes
2 answers

jsonpath-plus prblem with key that start with @ character

I am using jsonpath-plus 6.01. I have following JSON: { "Request": { "@Domain": "SomeDomain", "Vehicle": { "@ID": "E11XPD" } } } I can execute following jsonpath expression: $.Request['@Domain'] When I want to acces ID by…
Lucas
  • 81
  • 7
0
votes
1 answer

JSONPATH query in order to put condition on length of array?

$.paths["/inventory"].get.parameters.length i did this query to select the parameters og a get request and it works how ever i want to put a condition on the length of the array so that i can say the /inventory get requests must have 2 parms and…
mhido art
  • 1
  • 1
0
votes
2 answers

RestAssured JsonPath: Issue with getting data from json?

I need to know how to get this output - JSON DOC - { "status": "E000", "customerId": "VjAxI2VhNzg5ZmJlLWIyNjAtNGZlOS1iZDNkLTdjMmU1MjA2ZmVhZA", "merchantId": "1", "cards": [ { "cardType": "DEBIT", "cardIssuer": "AXIS", "cardBrand": "MASTERCARD",…
0
votes
1 answer

Using JSONPath to find an object based on one of its properties

Given the following JSON structure, I want to be able to find the entry in the $.data array that contains an item with a specific itemId. { "data": [ { "id": "1", "items": [{"itemId": "item1"}] }, { "id": "2", …
William Boman
  • 2,079
  • 5
  • 26
  • 39
0
votes
0 answers

How to filter an array of objects using multiple conditions in JSONPATH?

I am using jsonpath library (https://github.com/json-path/JsonPath) in Go, and I need to process a JSON object and filter from an array of objects, the objects which match any of the multiple criteria (OR conditions). I have been unsuccessful in…
abhishek
  • 671
  • 6
  • 14
0
votes
0 answers

Chaining JSON Paths in PostgreSQL

I am exposing JSONPaths for advanced queries in my application, and sometimes it would be really convenient to chain expressions as I'd do for example with jq. Example: { "foo": [ { "bar": "bar", "from": 10, "to": 20 } …
Radim Vansa
  • 5,686
  • 2
  • 25
  • 40
0
votes
1 answer

Checking for an element in an array with jsonpath_ng fails with JsonPathParseError

I am trying to filter elements of my JSON data which contain specific values in an array with jsonpath_ng in Python. The data looks like [ { "id": "a", "test": [ "a1", "a2" ] }, { "id": "b", "test": [ …
Kai
  • 160
  • 1
  • 1
  • 9
0
votes
2 answers

JSONPath Export Key & Value

I am using JSONPath to filter out a json file, I am trying to retrieve both the Key + Value from the JSON array but I am lost at figuring how best to do this. QUERY $.phoneNumbers[*].[type,number] ARRAY { "firstName": "John", "lastName" :…
Kyle McBride
  • 171
  • 1
  • 8
0
votes
1 answer

I want to know how to get Test1 value using Jsonpath

I want to know the value of "Test1" whose "createdTs" value is greater than or equal to 444. [ { "raw" : { "Test1":"Apple", "Test2":{ "createdTs": 333, "langCode": "ko" } } }, { "raw" : { …
testaaa
  • 15
  • 4
0
votes
1 answer

Can I use the JMeter result of Json Path Expression in Json Regex Extractor to extract only a part of the result?

The Json Path Expression returns something like: "folder/subfolder/123456". I only need the "123456", is it possible to extraxt that with the regular Expression extractor based on the result of the Json Path Extractor? Or another way would be…
KVG
  • 59
  • 8
0
votes
1 answer

JSON path to fetch value on a different node conditionally

On the below JSON example, I need to get only 1 ID when 'contenttype'!='helptext' I cannot do 'contenttype'=='textAreaSelectionLong' because a lot of other types are possible. Since it's on a different node on the same level as id, I don't know how…
Giftson David
  • 23
  • 1
  • 9
0
votes
1 answer

How to know if there are other paths than a given path?

Is it possible to know with JSONPath that other "paths" exist? By an existing "path" I mean a string in the form "a.b.c" or "a.b.d" like for this JSON: { 'a' : { 'b' : [ { 'c' : 0 }, { 'd': 1 ] } } Can a JSONPath be written to tell if…
Don Box
  • 3,166
  • 3
  • 26
  • 55
0
votes
0 answers

How to parse the key-value json in oracle 12.1?

I have below SQL query in Oracle 12c ( 12.1 and NOT 12.2. So I cannot use JSON_OBJECT_T ) . I need to print first column ( say key_str) with value like ABC, DEF etc while second column ( say val_str) as 123, 456 etc. However , I am unable to come…
user1289117
  • 115
  • 1
  • 6