Merge pull request #36 from noironetworks/noironetworks
Fix crashes on Python 2.7+ and when an operation is missing the "tags" key
This commit is contained in:
@@ -96,10 +96,10 @@ 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
|
||||
|
||||
if 'tags' in operation:
|
||||
for t in operation['tags']:
|
||||
operation_id = operation_id.replace(_to_camel_case(t), '')
|
||||
operation['operationId'] = operation_id
|
||||
|
||||
def add_custom_objects_spec(spec):
|
||||
with open(CUSTOM_OBJECTS_SPEC_PATH, 'r') as custom_objects_spec_file:
|
||||
@@ -123,7 +123,7 @@ def process_swagger(spec, client_language):
|
||||
apply_func_to_spec_operations(
|
||||
spec, remove_watch_operations, operation_ids)
|
||||
except PreprocessingException as e:
|
||||
print(e.message)
|
||||
print(e)
|
||||
|
||||
remove_model_prefixes(spec)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user