Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Requirement for double quotes for properties instead of null

SA-59530

Summary



Malformed JSON request was generated on sending empty values to Boolean, Integer, Decimal or Double type properties and HFix-35253 was provided to resolve it. Post applying HFix-35253, Pega generates JSON request with null values for Boolean, Integer, Decimal or Double type properties when empty value is provided for these type of properties.

Requirement for double quotes ("") for the properties instead of null for the use case.

For example,

The below sample response is generated by Pega post installing HFix-35253:

{ "TestBooleanRes":null,"TestDecimalRes":null,"TestIntegerRes":null,"TestDoubleRes":null}

User needs the response generated by Pega as below when empty values are sent to Boolean, Integer, Decimal or Double type properties:
{ "TestBooleanRes":"","TestDecimalRes":"","TestIntegerRes":"","TestDoubleRes":""}


Error Messages



Not Applicable


Steps to Reproduce

  1. Install HFix-35253
  2. Create a Service-REST integration
  3. Return the empty value to the Boolean, Integer, Double and Decimal type properties as response of the Service-REST integrationThe empty values for Boolean, Integer, Double and Decimal properties are replaced by null


Root Cause



This behavior is as per the JSON specifications.

Resolution



Here’s the explanation for the reported behavior:
According to the JSON specification, null represents a missing or an empty value. Representing the empty or missing value as 'False', 0 or "" is incorrect.



 

Published May 7, 2019 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us