hollingl
9 years agoOccasional Contributor
JSON integer property being transferred as a float
I am having some issues transferring a property from a JSON response payload to a subsequent REST call. I have two REST calls and between them a property transfer of an integer value in the payload to a URL parameter. While the value in the JSON is {"id":14}, it is being mapped into the target URL as /14.0/ - which my REST service rejects.
I understand that numbers are intrinsically floating point in JS(ON), but was wondering if there was any way I could apply a cast or truncation as part of the property transfer?
I am on SoapUI OS 5.2.1 on Windows 10.
- Instead of property transfer, you can use groovy script to read the value from json.
for eg:
http://stackoverflow.com/questions/16585063/how-to-extract-the-parameter-from-json-response-using-groovy