cancel
Showing results for 
Search instead for 
Did you mean: 

ReadyAPI response appending zeroes after decimal and also printing fields values as hexadecimal

Contributor

Re: ReadyAPI response appending zeroes after decimal and also printing fields values as hexadecimal

Hi Guys,

My apologies,I was offline for some time now as I have moved to a different organisation now and have no access to my previous work email which I have used to log a support ticket to this issue. Also I have encountered this issue when I have upgraded the version of ReadyAPI to the latest one and don't remember getting this issue on the older version of it. Also I have not tried ,if this issue actually reflects and affects in assertions. As I cannot access the previously used environment anymore ,I wont be able to answer much of the questions related to this topic and my apologies for that.

Highlighted
Contributor

Re: ReadyAPI response appending zeroes after decimal and also printing fields values as hexadecimal

Hi ,

My apologies,I was offline for some time now as I have moved to a different organisation now and have no access to my previous work email which I have used to log a support ticket to this issue. Also I have encountered this issue when I have upgraded the version of ReadyAPI to the latest one and don't remember getting this issue on the older version of it. Also I have not tried ,if this issue actually reflects and affects in assertions. As I cannot access the previously used environment anymore ,I wont be able to answer much of the questions related to this topic and my apologies for that.

New Contributor

Re: ReadyAPI response appending zeroes after decimal and also printing fields values as hexadecimal

I received the below response from SmartBear support. It may help if you are comparing a single field.  We compare the complete JSON so it does not help me.

 

"We had a bug regarding the JSON decimal in the earlier version which was fixed in 2.3. After the bug fix, the decimal type, which looks like 150.000(for example), is not truncated and the complete value is displayed.

 

You can use Script assertion to validate decimal type now (Please see attached - bigDecimalValue.jpg). There is an example:

 

def response = context.expand( '${REST Request#Response#$[\'decimal\']}' ) // replace the JSONPath expression with the correct one assert 150.0 == new BigDecimal(response)."