% for rule in rules :

{{ rule["path"] }} ({{ ', '.join(map(lambda item: item['name'] + ': ' + item['type'] + (' = "' + item['default'] + '"' if item['has_default'] else ''), rule['form'])) }})

% if rule["doc"]:

{{rule["doc"]}}

% else:

Docs are planned to be here

% end

Try it:

% for item in rule['form'] :
% if item["type"] == "str" or item["type"] == "integer": % elif item["type"] == "boolean":
% elif item["type"] == 'array':
{{item["name"]}} % if item["required"]: * % end +
% for (subitem, j) in item['default'] :
% for (value, key) in subitem :
% end
-
% end
% elif item["type"] == 'object':
{{item["name"]}} % if item["required"]: * % end % if not item['default']: + % end
% for (value, key) in item['default']:
% end
% end
% end
% end