make res_headers a TypeTable

... rather than a list of rows
pull/977/head
Richard van der Hoff 7 years ago
parent 96650e2824
commit 93ff0713cb

@ -27,10 +27,10 @@ Request format:
`No parameters` `No parameters`
{% endif %} {% endif %}
{% if endpoint.res_headers|length > 0 -%} {% if endpoint.res_headers is not none -%}
Response headers: Response headers:
{{ tables.paramtable(endpoint.res_headers) }} {{ tables.paramtable(endpoint.res_headers.rows) }}
{% endif -%} {% endif -%}
{% if endpoint.res_tables|length > 0 -%} {% if endpoint.res_tables|length > 0 -%}

@ -443,7 +443,7 @@ class MatrixUnits(Units):
"rate_limited": 429 in endpoint_swagger.get("responses", {}), "rate_limited": 429 in endpoint_swagger.get("responses", {}),
"req_param_by_loc": {}, "req_param_by_loc": {},
"req_body_tables": [], "req_body_tables": [],
"res_headers": [], "res_headers": None,
"res_tables": [], "res_tables": [],
"responses": [], "responses": [],
"example": { "example": {
@ -521,10 +521,9 @@ class MatrixUnits(Units):
good_response["schema"] good_response["schema"]
) )
if "headers" in good_response: if "headers" in good_response:
headers = [] headers = TypeTable()
for (header_name, header) in good_response[ for (header_name, header) in good_response["headers"].iteritems():
"headers"].iteritems(): headers.add_row(
headers.append(
TypeTableRow(key=header_name, typ=header["type"], TypeTableRow(key=header_name, typ=header["type"],
desc=header["description"]), desc=header["description"]),
) )

Loading…
Cancel
Save