Question

2
Replies
486
Views
BANDHAMNENI Member since 2012 3 posts
Infosys
Posted: August 28, 2018
Last activity: September 17, 2018
Closed

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***

Data Integration
Moderation Team has archived post
Share this page LinkedIn