Top "Jsonpath" questions

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

AWS Step Function - Adding dynamic value to Pass state type

I have the following state defined in my state machine. "loop":{ "Type": "Pass", "Result":{ "totalCount": "$.newFieldsResponse.body.count", "currentCount": 0, "step": 1 }, "…

json amazon-web-services jsonpath aws-step-functions
Optional JsonPath using Jayway

Question: I have a service that takes in a JSON string as input. The JSON schema is different every time …

java json jsonpath
how to Validate if JSON Path Exists in JSON

In a given json document, how to validate if a json path exists ? I am using jayway-jsonpath and have the …

json jsonpath
JSON Get parent object from child object

How can I get discount value if brand_id=='983'. Sample JSON: { "prods": [ { "info": { "rate": 100 }, "grocery": [ { "brand": "A", "brand_…

json jsonpath
select multiple attributes with jsonpath

I have an array of objects like this one: [ { "id": 192, "name": "Complete name", "username": "nsurname", "state": "active", "created_at": "2016-05…

json jsonpath
How to list object key names with jsonpath?

I am using nodejs with jsonpath. I have this json structure: { things:{ books: [ {name: "book1"}, {name: "book2"}, {name: "book3"}, {name: "…

json node.js jsonpath
Get keys in JSON

I get the following JSON result from an external system: { "key1": "val1", "key2": "val2", "key3": "val3" } Now I want to …

json jsonpath
Check output of JsonPath with Hamcrest Matchers

I wrote Spring controller Junits. I used JsonPath to fetch all IDs from JSON using ["$..id"]. I have following as …

java junit spring-test hamcrest jsonpath
Jsonpath for length of array

Given json such as {"arr1" : [1,2,3], "arr2" : []} where it is known that there are arrays named arr1 and arr2, is there …

arrays groovy size spock jsonpath
JSON PATH Field NULL Checking Expression

I have a json array like bellow : { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "…

java json jsonpath