Hello,
I'm hoping that someone can shed some light on the following data action and implementing the translation map.
I have the Input Contract as follows
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Account Details Request",
"description": "Account GUID request for customer data.",
"type": "object",
"properties": {
"accountnumber": {
"type": "string"
}
},
"additionalProperties": true
}
The output contract is as follows:
{
"description": "This is the contract that will be enforced. See the success template for how this is produced. Returns the full response.",
"type": "array",
"properties": {},
"items": {
"title": "Item 1",
"type": "object",
"properties": {
"BeneficiaryGuid": {
"type": "string"
}
},
"additionalProperties": true
}
}
The translation mapping that i put together is as follows.
{
"translationMap": {
"BeneficiaryGuid": "$.BeneficiaryGuid"
},
"translationMapDefaults": {
"BeneficiaryGuid": ""
},
"successTemplate": "{\n "BeneficiaryGuid": ${BeneficiaryGuid} \n}"
}
Whenever i run the test, I'm getting the following error message:
10. Apply output transformation: Transform failed to process result using 'successTemplate' template due to error:'Unexpected character ('}' (code 125)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (String)"{ "BeneficiaryGuid": }"; line: 3, column: 2]' Template:'{ "BeneficiaryGuid": ${BeneficiaryGuid} }'.
I checked the mapping in JSON Online Validator and Formatter - JSON Lint and it's valid. So, I'm not sure what exactly I'm missing here.
Any help that you can provide would be greatly appreciated.