From a122014d50624cdcc1cd916f10ab65d64996dd7d Mon Sep 17 00:00:00 2001 From: Michael Mulich Date: Mon, 29 Jan 2018 10:56:30 -0800 Subject: [PATCH] Prevent a KeyError when tags isn't present --- sphinxcontrib/swaggerdoc/swaggerv2_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinxcontrib/swaggerdoc/swaggerv2_doc.py b/sphinxcontrib/swaggerdoc/swaggerv2_doc.py index e1ed323..058a457 100644 --- a/sphinxcontrib/swaggerdoc/swaggerv2_doc.py +++ b/sphinxcontrib/swaggerdoc/swaggerv2_doc.py @@ -196,7 +196,7 @@ def group_tags(self, api_desc): if SwaggerV2DocDirective.DEFAULT_GROUP in groups: groups[SwaggerV2DocDirective.DEFAULT_GROUP].append((path, method_type, method)) else: - for tag in method['tags']: + for tag in method.get('tags', []): groups.setdefault(tag, []).append((path, method_type, method)) return groups