Pega encloses decimal property values in Double Quotes in JSON response object
We are generating JSON response object using getJSON() method. This method is enclosing double quotes around all the property types (Decimal, Date, Boolean, Integer) and making it as string. The consuming system is taking it as String instead of it's original property type.
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.
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 it's original property types.
Message was edited by: Vidyaranjan Av | Included category
I have taken ownership of this ticket for research and resolution. From my understanding of the getJSON method, its purpose was only intended to create a simple JSON "clipboard" representation of the step page and therefore does not resolve the "Pega type" to a valid "JSON type". Everything is represented in JSON as strings. As you probably have noticed, it also adds pxObjClass for context.
We're using JSON in the context of "Service REST".
Yes, getJSON method creating the Clipboard page into JSON as Strings. This may be as intended. However, we wanted to retain Page data types into valid JSON data types. I wish to explore other options (if any).
This can only occur if EndDate is present on the page, maybe it is just initialized to empty string via data transform. To get rid of it in the JSON, you need to remove it from the page using Property-Remove.