How to return a custom response from application integration service?

I am using a Return Task to customize the responsebody before sending it to the consumer.

shirgillfarhan_3-1696188451562.png

 

 

 

The first issue is

1) As seen on the right side, Customized return message is set to responseBody which is a JSON datatype. i see it is displayed as a string datatype in view mode. When i click on the variable it is properly shown as JSON.

shirgillfarhan_2-1696188403423.png

 

2) Secondly, the response body is set to as shown below

shirgillfarhan_4-1696188502300.png

 

 

However i hit the integration from postman, the response is shown as -

shirgillfarhan_0-1696188964837.png

 

 

As seen the custom response body created by me comes embedded in message tag. 

 

The response status code is reflected correctly (409) hardcoded in JS Data Manipulation Task. But the response body in postman isnt the same as the customized one set by me.

 

Please suggest.

 

 

 

 

1 REPLY 1

Hi,

Currently we only support 'String' type variable in customized error message for return task. We may consider supporting other data types(e.g. json) in the future. Meanwhile, we will update our official doc and throw error when data type is not 'string' for return task soon

Thanks,

Dianjin