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

json-path: first element from an array fiilter result

I'm new to json-path, but I have often used xpath. My problem is to extract, with json-path, the nth element of an array resulting from a previus filter. For example with the following json { "store": { "book": [ { …
fede.dev
  • 3
  • 1
  • 2
0
votes
1 answer

How to filter out a JSON based on list of paths in JQ

Given an arbitrary JSON input: { "id":"038020", "title":"Teenage Mutant Ninja Turtles: Out of the Shadows", "turtles":[ { "name":"Leonardo", "mask":"blue" }, { "name":"Michelangelo", …
caulitomaz
  • 2,141
  • 14
  • 20
-1
votes
1 answer

JMeter json path extractor and Regular expression combination

I want to extract sys_id for the employee_number does not starting with "C" { "items": [{ "sys_updated_on": "2021-01-15 15:04:04", "sys_id": "60eaa1dc47870d9132f624846d434a", "employee_number": "C89" }, { …
vikas
  • 496
  • 3
  • 15
-1
votes
2 answers

How to extract a complex value in JsonPathExtractor

Below is the returned sample json [ "id": [ { "reports": [ { "metadata": { "materialName" : "materialName1" …
-1
votes
1 answer

I want to extract only a specific value using jsonpath

How to use jsonpath to extract only id value from Json like below? [ { "Name": "Test", "Code": "00", "options": [ { "id": "SS111", "roundTrip": false, "price": 53900, "trains": [ …
testaaa
  • 15
  • 4
-1
votes
2 answers

How to extract value from JSON Path extractor based on condition

I would like to get the value of the "currentApproversStr:" based on the condition "status":"Ready for Review" from the below JSON Response body of a HTTP sampler and pass to following HTTP sampler. I tried the below but it's not working Names of…
rpagadala
  • 796
  • 2
  • 15
  • 31
-1
votes
1 answer

EvaluateJsonPathAttributeCustom - Nifi

I have to extract attributes from a json file that I receive from an api call using InvokeHTTPCustom. JSON FILE has the following sample data : [ { "input_index": 0, "candidate_index": 0, "delivery_line_1": "1 Santa Claus…
-1
votes
1 answer

JSONPath issu returning value using a filter

I have the following json, for which I'm having trouble selecting one of the values using a filter. Specifically, I want to return "POS_Undeclared" {"wd:Program_of_Study_Reference": { "wd:ID": [ …
ACesario
  • 89
  • 9
-1
votes
2 answers

jsonPath predicate to return the whole JSON

I would like to return the whole JSON if a condition is matched. Test Json: { "EVENTID": 2624367601, "RECEIVERNAME": "CM.MYHR", "SENDERNAME": "CM.EIS.CF1", "AGREEMENTNAME": null } I keep…
Autorun
  • 319
  • 2
  • 8
  • 20
-1
votes
1 answer

jsonpath find all keys leave contains a string

I'm using the JSON path to my elaborate. I need to find all final leaves nodes which contain a specific string. Suppose you have a json : { 'nested' :{ 'leaf1' : 'MY_STRING_TO_FIND' }, 'leaf2' : 'MY_STRING_TO_FIND' } my…
Peter Pan
  • 9
  • 2
-1
votes
1 answer

jmeter: evaluate the values of JSON values

I am trying to test my API response using JSON assertion in JMeter, but couldn't find out on how to achieve it. The API returns 2 values, and I need to check if the difference between these two value are consistent API response: { "start":…
Girish BN
  • 91
  • 2
  • 13
-1
votes
1 answer

How to build jsonpath expression for checking the number of times in array?

Suppose I have a json like this { "city" :[ "Bangalore", "Delhi", "Chennai", "Bangalore" ] } Now I want to make a make a json path query to check if bangalore is occuring twice or not so to check that I want to extract no of times Bangalore is…
agrawal1084
  • 129
  • 2
  • 11
-2
votes
1 answer

array of string to string

Can I use JSONPath expressions to get a string out of an array of string? Example, here is an array of strings: { "objects": [ "a", "b", "c" ] } and the expresion $.objects[:] will result into [ "a", "b", …
herrwolken
  • 389
  • 1
  • 4
  • 12
1 2 3
11
12