I'm using a JSON export mapping for the response of my published Rest service. The response is serialized using an Export With Mapping action. Unfortunate the serialization does not escape characters like ", \ and line breaks. The serializeObjectToJson call from the REST module does escape characters, but I cannot use this because I will not have any control over the mapping. The only solution I see now is to call a microflow for each string attribute I want to include in my response. Do I miss something and is there an easier solution? Or will the ExportWithMapping action be changed in future Mendix versions so that it generates valid JSON in all situations?
asked
Diederik Wentink
3 answers
3
I don't know where this was fixed, but in Mendix 7.3 it properly escapes " and \
answered
Fabian Recktenwald
3
Hi Diederik Wentink
Use urlencode before you stringUse urlencode before you stringUse urlencode before you stringUse urlencode before you string
Thank you !!!
answered
Elamathi S
1
In the old REST module you had the Java action urlEncode so you could urlEncode the string before passing.