Question
Lanit
RU
Last activity: 12 Jan 2021 6:18 EST
Decimal value is truncated after parsing JSON response from REST integration
I came across a problem with REST integration which uses JSON - in response message we have a decimal field with value 123456789012345.1234567. After changing logging level for com.pega.pegarules.integration.engine.internal.connect.rest.RESTConnector to Debug I saw in the logs that the JSON response message that we are receiving is correct.
However after Pega parsed it into internal data model decimal value was truncated to 123456789012345.12. It seems that Pega can only handle numbers with 17 digits (another example - value 1.234567890123451234567 is truncated to 1.2345678901234511)
I have tried changing property type to Double and Decimal, result is the same. I also tried turning on "Use fast processing" in REST connector settings but that didn't help either.
Can I somehow change the way Pega parses JSON values to prevent data loss?
update: Same thing happens when JSON message is serialized and deserialized, after 17 digits decimal number is truncated.