We are using twig render engine, to populate json with payload data.
Or said in other words:
{
"payload": {
"sld": "{{sld}}",
"tld": "{{tlds}}"
}
}
I am looping all variables and "rendering" the values. When everything is strings, it is working perfectly
{
"payload": {
"sld": "test",
"tld": "com"
}
}
BUT, if any of the twig variables is array it is crashing. Or said with other words:
{{tlds}} is array === ["com", "net"]
because it is stored in json, I can not write it without the string quotes "".
The expected result should be:
{
"payload": {
"sld": "test",
"tld": ["com", "net"]
}
}
Can you help me with a solution or workaround?