Questions tagged [jayway]

69 questions
1
vote
1 answer

Keep Trailing zeros when Parsing Json using jayway JsonPath

I am using jayway json-path - 2.4.0 to parse Json. When Parsing json, if the json contains any double value, its truncating the trailing zeros. For Example, I have a Json String like below. {"name" : "Sparker" , "value": 60.10} And my…
sparker
  • 1,666
  • 4
  • 21
  • 35
1
vote
0 answers

JsonPath (JayWay) that returns only specific keys for objects in a JSON array that have those keys

Objective: I have a JSON with an array of JSON objects. I want to return only array objects that have certain members (string:element) with particular strings. Of those filtered objects in the array, I want to return only the filtered strings,…
Humberto
  • 99
  • 12
1
vote
0 answers

com.jayway.jsonpath.InvalidPathException: Space not allowed in path

I'm using JsonPath to check matches of some json-paths against a JSON document with a SpringBoot application. It gives the following exception when I include in operator inside the expression. But the same jsonpath expression works fine online. I…
0
votes
0 answers

Creating JSON document object model (DOM) using JSON Path (JayWay) in Java

I want to create a JSON String for a Map of JSON Path as key and the value is the JSON value itself. (It is somehow mentioned here as a solution) but neither 2.7 nor 2.8 version of Jayway's published maven Central has…
user2792012
  • 43
  • 1
  • 5
0
votes
1 answer

Parsing a Json response using Jayway JsonPath

i have the below Json structure, { "MyData": { "Type": "ABC", "Id": "567", "Number": "888" }, "RefId": "9999", "DataValues": [ { "NumberList": [ "7777777" ], "NumberId": "888888888", "Phone":…
VinodKhade
  • 147
  • 1
  • 2
  • 10
0
votes
1 answer

JSONParser cannot be resolved to a type when I upgrade Json-path to 2.8

I have a project, which is using jayway jsonpath com.jayway.jsonpath json-path 2.7.0 compile
Justin
  • 1,050
  • 11
  • 26
0
votes
1 answer

Filter object elements with Jayway Jsonpath

I have a list of (somehow "well-behaved") jsonpaths and I have to return an object which contains only the elements described in the list. For example, given the list ["$.a.a2", $.c] and the object { "a": {"a1": 1, "a2": 2}, "b": foo, …
dcolazin
  • 831
  • 1
  • 10
  • 25
0
votes
1 answer

Get Json path of objects when navigation through a Json using Java and Jayway JsonPath

I am witing a user interface in Java that allows the enduser to navigate in a JSON using Jayway JsonPath. So given the example below { "people": [ { "id": 1, "fname": "Henry", "lname": "Cavendish", …
Thorsten
  • 315
  • 2
  • 7
0
votes
1 answer

How to get json path in java when the json value has hyphen

How to get json path in java when the json value has hyphen? I have com.jayway.jsonpath.InvalidPathException. Error message: com.jayway.jsonpath.InvalidPathException: Expected character: ) at…
Mahen C
  • 11
  • 1
  • 6
0
votes
1 answer

Get Parent Node using Jayway JSONPATH

In the below JSON file I want to extract the empDetails.name where one or both iscomponentInSal is true . JSON [ *// Retrieve below `empDetails.name` as for one of the components we have `"iscomponentInSal": true`* { "empDetails": { …
Mandy
  • 433
  • 2
  • 8
  • 25
0
votes
0 answers

How would I access array within JSon object using JayWay JsonPath?

I am trying to access the values for each of the three Awards object under the 2nd "text" component in the below JSON using Java. I ultimately want to create objects with the information. { "searchApiFormatVersion": "1.0", "searchName":…
Ashley Xu
  • 124
  • 1
  • 7
0
votes
2 answers

How to conditionally extract a Json value using JayWay JsonPath?

I have the following JSON: { "A":{ "C":{ "date":"2022-01-23" } }, "B":{ "D":{ "date":"2022-01-24" } } } I would like to extract the value $.A.C.date if it is not null, else I would like to…
Matteo NNZ
  • 11,930
  • 12
  • 52
  • 89
0
votes
0 answers

jayway library | JSON Path Expression Behaviour

I am having a doubt where while giving a JSON Path, I am getting following output. Input JSON :- { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", …
agaonsindhe
  • 447
  • 1
  • 5
  • 13
0
votes
0 answers

Getting error while trying to fetch integer value from json response using jayway json path

I am trying to fetch data from JSON array of response using jayway JSON path in selenium java. Able to fetch string values, but getting error for integer and other values. Can anyone please help me on this. ex Json: [ { "id":23961, …
0
votes
2 answers

How to check the input string present in json array using json path

I am trying to check the given input string is present in a json array. Below is my sample json { "school": { "class": { "standard": "6", "student_list": [ "Daniel", "Jack", …
user13906258
  • 161
  • 1
  • 13