From db27ecccbbd4ef05225d797f294a6ea8b8d22985 Mon Sep 17 00:00:00 2001 From: Ceridwen Date: Wed, 15 Nov 2017 10:08:44 -0800 Subject: [PATCH] Skip over operations with missing "tags" key --- scripts/from_gen/preprocess_spec.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/from_gen/preprocess_spec.py b/scripts/from_gen/preprocess_spec.py index 45bb6da7..5f3ec6b7 100644 --- a/scripts/from_gen/preprocess_spec.py +++ b/scripts/from_gen/preprocess_spec.py @@ -96,10 +96,12 @@ def remove_watch_operations(op, parent, operation_ids): def strip_tags_from_operation_id(operation, _): operation_id = operation['operationId'] - for t in operation['tags']: - operation_id = operation_id.replace(_to_camel_case(t), '') - operation['operationId'] = operation_id - + try: + for t in operation['tags']: + operation_id = operation_id.replace(_to_camel_case(t), '') + operation['operationId'] = operation_id + except KeyError: + pass def add_custom_objects_spec(spec): with open(CUSTOM_OBJECTS_SPEC_PATH, 'r') as custom_objects_spec_file: