diff --git a/templating/matrix_templates/templates/http-api.tmpl b/templating/matrix_templates/templates/http-api.tmpl index ef796f4e..461a0b58 100644 --- a/templating/matrix_templates/templates/http-api.tmpl +++ b/templating/matrix_templates/templates/http-api.tmpl @@ -27,10 +27,10 @@ Request format: `No parameters` {% endif %} -{% if endpoint.res_headers|length > 0 -%} +{% if endpoint.res_headers is not none -%} Response headers: -{{ tables.paramtable(endpoint.res_headers) }} +{{ tables.paramtable(endpoint.res_headers.rows) }} {% endif -%} {% if endpoint.res_tables|length > 0 -%} diff --git a/templating/matrix_templates/units.py b/templating/matrix_templates/units.py index 6d554737..dd33d400 100644 --- a/templating/matrix_templates/units.py +++ b/templating/matrix_templates/units.py @@ -443,7 +443,7 @@ class MatrixUnits(Units): "rate_limited": 429 in endpoint_swagger.get("responses", {}), "req_param_by_loc": {}, "req_body_tables": [], - "res_headers": [], + "res_headers": None, "res_tables": [], "responses": [], "example": { @@ -521,10 +521,9 @@ class MatrixUnits(Units): good_response["schema"] ) if "headers" in good_response: - headers = [] - for (header_name, header) in good_response[ - "headers"].iteritems(): - headers.append( + headers = TypeTable() + for (header_name, header) in good_response["headers"].iteritems(): + headers.add_row( TypeTableRow(key=header_name, typ=header["type"], desc=header["description"]), )