Support Article

JSON invalid property error, when prop name starts with "_"



A service call to an external service, that returns a JSON object containing JSON property with underscore ("_")  in the name, (for example, "_type") throws error.

Error Messages

2015-09-16 05:43:51,162 [    WebContainer : 6] [  STANDARD] [] ( engine.internal.ServiceHelper) WARN  - The reference __type is not valid.  Reason: invalid property name: '__type', update "@baseclass.pyInboundIdentifierEncoder" and "@baseclass.pyOutboundIdentifierDecoder" decision tables to replace the invalid character in the incoming request data.
2015-09-16 05:43:51,167 [    WebContainer : 6] [  STANDARD] [] (      internal.mgmt.Executable) ERROR  - Exception Error mapping incoming response to .Response: PRException
From: (H5486F38621DB11E688C51B6B33313995)
 at com.pega.pegarules.integration.engine.internal.util.PRServiceUtils.mapInboundData(
 at com.pegarules.generated.activity.ra_action_pyinvokerestconnector_fc074fcfd08f456a146ef116b16a2c3f.step7_circum0(
 at com.pegarules.generated.activity.ra_action_pyinvokerestconnector_fc074fcfd08f456a146ef116b16a2c3f.perform(
 at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(
 at com.pegarules.generated.activity.ra_action_invoke_6a91441c4f6e5048b63360383ae1b952.step7_circum0(
 at com.pegarules.generated.activity.ra_action_invoke_6a91441c4f6e5048b63360383ae1b952.perform(
 at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(
Caused by: Error mapping incoming response to .Response: PRException
 at com.pega.pegarules.integration.engine.internal.ServiceHelper.setInboundJsonValue(
 at com.pega.pegarules.integration.engine.internal.ServiceHelper.setInboundDataValue(
 at com.pega.pegarules.integration.engine.internal.ServiceHelper.mapInboundData(
 at com.pega.pegarules.integration.engine.internal.util.PRServiceUtils.mapInboundData(

Steps to Reproduce

Use Connect-REST to invoke a REST connection that will return a property that starts with an underscore. It fails when it tries to map back.

Root Cause

An issue in the custom application code or rules. When using REST integration wizard to generate properties and data mapping, PegaRULES engine handles the scenario where property name starts with an underscore. The Engine renames it and appends uScore in the beginning of the property name, for example, it would rename "_type" property to "uScore_property".
In this scenario, properties were not generated using REST integration wizard but were created manually. Pega
does not allow user defined properties that start with underscores.


Perform the following local-change:

1. A
dd pzExternalName qualifier to Advanced tab of the properties where the issue is occurring.
2. Map the pzExternalName qualifier for the property, such as, uScore_type and set the value as the _type (original JSON name).
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

75% found this useful

Have a question? Get answers now.

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