0

I am observing that the format or value of an item from a rest-assured response is changed when I try to retrieve the item using JsonPath.

Value of the field is 16637906.26 when I get the response.asString().

However when I retrieve this specific information using JsonPath, it returns the number as 1.6637906E7.

Below is the rest-assured JsonPath I used to get the data:

List<Map<String,?>> values = JsonPath.with(actResponse).param(param,value).get("entries.findAll { entries -> entries."+param+" == "+param+" }")

where param is a variable pointing to parameter I use.When I print this List, I can see that the value is then displayed as 1.6637906E7. All other smaller values are returned properly.

I tried to play with it a bit like converting the number etc, however nothing seem to work.

Highly appreciate if someone can guide me through this.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • You requesting response to provide value in asString , In this case, It will do exactly what needs to do . – N.. Jan 14 '16 at 14:35
  • And I see the proper value when I get the response.asString(). Also the actResponse passed to JosnPath is the exact same response.asString(). – Amith Ramachandran Jan 14 '16 at 15:32

0 Answers0