From 0a9f61029a82ad67f9b02e054fd5238e976905d3 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Tue, 8 Sep 2015 11:16:48 +0100 Subject: [PATCH] Allow for missing responses key --- templating/matrix_templates/units.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templating/matrix_templates/units.py b/templating/matrix_templates/units.py index 42ce3f22..5852b438 100644 --- a/templating/matrix_templates/units.py +++ b/templating/matrix_templates/units.py @@ -178,7 +178,7 @@ class MatrixUnits(Units): endpoint["req_param_by_loc"][p["loc"]].append(p) endpoint["example"]["responses"] = [] # Ordered list of maps - for code, res in single_api["responses"].items(): + for code, res in single_api.get("responses", {}).items(): description = res.get("description", "") example = res.get("examples", {}).get("application/json", "") if description and example: