diff --git a/resources/simplex/simplex.py b/resources/simplex/simplex.py index d5965e0cda5f320d21fc41798235fad671f7f25f..82e9ea830298c0efbbec899c1c3d1e78326c5f5b 100644 --- a/resources/simplex/simplex.py +++ b/resources/simplex/simplex.py @@ -81,6 +81,16 @@ class Simplex(): Attempts to parse passes JSON data into simplex format. :param json_data: JSON data to attempt to parse. """ + # Check that param is of dict type. + if not isinstance(json_data, dict): + raise TypeError('Expected "json_data" param to be of dict type.') + + # Set all key names to be lowercase. + new_dict = {} + for key, value in json_data.items(): + new_dict[str(key).lower()] = value + json_data = new_dict + # Check that "constraint" key exists. if 'constraints' in json_data: matrix_a = json_data['constraints'] @@ -124,8 +134,6 @@ class Simplex(): # Check if "description" key exists. if 'description' in json_data: description = json_data['description'] - elif 'Description' in json_data: - description = json_data['Description'] else: description = None