kolypto / j2cli

Jinja2 Command-Line Tool, reworked

Home Page:http://pypi.python.org/pypi/j2cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arrays in json

nickstatka777 opened this issue · comments

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?

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

{{ my_array | tojson }}