Using jsonnet

Jsonnet is a data templating language to generate config data.

It avoids duplications using object orientation.

E.g. eg.jsonnet

output.json

 

 

Jinja Templates and JSON with Python

  1. Loading up a Jinja Template and some JSON using Python then outputting that JSON in the template:

k.py

template.j2

api.json

2. Outputting the value of api when done is true

api.json

template.j2

See also:

http://jinja.pocoo.org/docs/dev/templates/#expressions