Question
Infosys
IN
Last activity: 17 Sep 2018 7:09 EDT
encloses decimal property values double quotes json response
hello,
We are generating JSON response object using pxConvertPageToString function and passing parameter format as JSON. This function is enclosing double quotes around all the property types (Decimal, Date, Boolean, Integer) and making it as a string. The consuming system is taking it as String instead of its original property type.
By using Map from as JSON on the response tab of the Service REST rule will work, but we have many API's so, we have generic code to send a response back instead of mapping every rest rule.
Ex: I have a property; Amount' of type Decimal. This property has to be incorporated into JSON as Decimal, but getJSON() method forming JSON object with Amount as String.
JSON Output:
{"ServiceFee": {
"Amount": "200.25",
"CurrencyCode": "USD"
}}
Is there any way to get rid of the double quotes in JSON and rather than converting it to String, can we form the JSON object with its original property types.
***Moderator Edit-Vidyaranjan: Updated Platform Capability***