Lahiru Madushanka created FREEMARKER-231:
--------------------------------------------
Summary: Config to support [?json_string] globally
Key: FREEMARKER-231
URL: https://issues.apache.org/jira/browse/FREEMARKER-231
Project: Apache Freemarker
Issue Type: Bug
Affects Versions: 2.3.30
Reporter: Lahiru Madushanka
Hi Devs,
I'm creating this issue on behalf of the WSO2 Micro Integrator team. We are
using Freemarker in our product to transform user payloads and are quite happy
with the functionalities and ease of use.
Recently, we got an issue from our customer saying the String values are
getting escaped in a JSON payload
25.09\t& get changed to 25.09[0x09]&
Sample configuration
{code:java}
"ResponsePayload": { "result": { "Table": { "FAULT_DESC": "${ctx.CEPFaultDesc}"
} }
{code}
We later inject the ctx.CEPFaultDesc value to freemarker.
Upon doing some research, we asked the customer to use the following config
with ?json_string, which resolved the issue
{code:java}
"ResponsePayload": { "result": { "Table": { "FAULT_DESC":
"${ctx.CEPFaultDesc?json_string}" } }{code}
But, the problem is we feel like it's wrong to escape the string values. We are
creating this issue to check if there's a way to apply this config change
globally (not in individual fields). If not, will it be considered in a future
release?
We are using version 2.3.30
Thanks in advance.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)