Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Arrays in json #59

Open
nickstatka777 opened this issue May 23, 2020 · 1 comment
Open

Arrays in json #59

nickstatka777 opened this issue May 23, 2020 · 1 comment

Comments

@nickstatka777
Copy link

Hello, I have a problem. When I try to pass an array from a template.json to the dest JSON file the result looks incorrect:
example:
template file:
{ "inpath": ["/2_dir","/3_dir"] }

in the destination file:
{ "paths": ['/2_dir', '/3_dir'] }
I'm about single quote, however, it should be double quotes. So, what do I wrong?

@robmoore
Copy link

@nickstatka777 This can be accomplished using the tojson filter like so:

{{ my_array | tojson }} 

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants