Hello,
I receive input for my workflow from an API containing JSON content. This JSON content does not contain
valid Jinja expressions and I don’t want to parse any Jinja inside.
Nevertheless it looks like this is the default behaviour. Is there any possibility to not evaluate Jinja
inside this JSON?
As example I created the following simplified test wfl for you:
version: 1.0
description: Parse error
vars:
- test_in: {
"md5": "93c8469e0ae544e3437a8762e35a48b2",
"raw_headers": "X-Triage-Noise-Reduction: state=0
Subject: [EXT] +{{{{{ McAfee_SECURITY_SERVICE }}}}+
Thread-Topic: [EXT] +{{{{{ McAfee_SECURITY_SERVICE }}}}+
Thread-Index: AQHXU9CCsPPgqyQZN0Ort1HhdcR5dQ==
Date: Fri, 21 May 2021 13:48:06 +0000
...",
"subject": "[EXT] +{{{{{ McAfee_SECURITY_SERVICE }}}}+",
"processed_at": "2021-06-02T15:07:00.739Z"
}
tasks:
Testout:
action: core.echo
input:
message: <% ctx().test_in.processed_at %>
Already during the parsing of the input value the wfl crashes with following error:
{
"errors": [
{
"expression": "X-Triage-Noise-Reduction: state=0 Subject: [EXT] +{{{{{ McAfee_SECURITY_SERVICE }}}}+ Thread-Topic: [EXT] +{{{{{ McAfee_SECURITY_SERVICE }}}}+ Thread-Index: AQHXU9CCsPPgqyQZN0Ort1HhdcR5dQ== Date: Fri, 21 May 2021 13:48:06 +0000 ...",
"message": "expected token ':', got '}'",
"spec_path": "vars",
"schema_path": "properties.vars",
"language": "jinja",
"type": "expression"
},
{
"expression": "[EXT] +{{{{{ McAfee_SECURITY_SERVICE }}}}+",
"message": "expected token ':', got '}'",
"spec_path": "vars",
"schema_path": "properties.vars",
"language": "jinja",
"type": "expression"
}
],
"output": null
}
In my real world example the test_in content is part of a more complex structure and I don’t see any possibility to escape this characters or something like this.
Any idea how to solve this issue are welcome.
Thanks.
Nikolas