From 7bd45a340487183cfbeae935bd744ee0d60e5528 Mon Sep 17 00:00:00 2001 From: Paul Coccoli Date: Tue, 25 Jul 2023 17:09:55 -0400 Subject: [PATCH] map_validator: make sure 'object' name is a str --- map_validator/validate_mapping.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/map_validator/validate_mapping.py b/map_validator/validate_mapping.py index 3ac2148c2..669b47d3e 100644 --- a/map_validator/validate_mapping.py +++ b/map_validator/validate_mapping.py @@ -103,12 +103,17 @@ def main(): # "object" is an optional name for target SCO obj = mapping.get('object') + if obj is not None: + if not isinstance(obj, str): + log_error(mapping, '"object" is not a string') + continue # This is "fatal" for this mapping # Validate key key = mapping['key'] if not isinstance(key, str): log_error(mapping, '"key" is not a string') continue # This is "fatal" for this mapping + otype, _, rest = key.partition('.') if not rest: # No SCO type, so it's an observed-data property