Skip to content
Discussion options

You must be logged in to vote

{{data}} interpolates the object as a python string.

A quick websearch shows that jinja2 has a tojson filter.

>>> from jinja2 import Template
>>> t = Template('{"extra_vars":{{data | tojson}}}')
>>> t.render(data={"bar":"baz"})
'{"extra_vars":{"bar": "baz"}}'
>>> 

That is: try {"extra_vars":{{data | tojson}}} as your body template.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Kani999
Comment options

@candlerb
Comment options

@candlerb
Comment options

@Kani999
Comment options

@Dees7
Comment options

Answer selected by ryanmerolle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #6512 on June 01, 2021 12:30.