diff --git a/LCS/PyCommon/json_utils.py b/LCS/PyCommon/json_utils.py index e3a17edcc9d4c397f0a83458ec248a578d0b5b49..4051c3e87e172e97d55b91dc35965e5907e5b83a 100644 --- a/LCS/PyCommon/json_utils.py +++ b/LCS/PyCommon/json_utils.py @@ -397,10 +397,6 @@ def resolved_local_refs(schema): # recursively resolve the schema resolved_schema = _recursive_resolved_local_refs(schema) - # definitions are no longer needed in the resolved schema, as all refs are resolved. - if 'definitions' in resolved_schema: - del resolved_schema['definitions'] - return resolved_schema diff --git a/LCS/PyCommon/test/t_json_utils.py b/LCS/PyCommon/test/t_json_utils.py index 116fca9744b71d1725cbccf0e3cc226ae7a9874b..4dbadeead071ea81839fd5b39c1cabf424ab22a7 100755 --- a/LCS/PyCommon/test/t_json_utils.py +++ b/LCS/PyCommon/test/t_json_utils.py @@ -137,6 +137,40 @@ class TestJSONUtils(unittest.TestCase): expected_resolved_user_schema = { "type": "object", "default": {}, + 'definitions': {'account': {'properties': {'creation_at': {'description': 'A ' + 'timestamp ' + 'defined ' + 'in ' + 'UTC', + 'format': 'date-time', + 'pattern': '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(\\.\\d+)?Z?', + 'type': 'string'}, + 'email_address': { + 'format': 'email', + 'pattern': '@example\\.com$', + 'type': 'string'}}, + 'type': 'object'}, + 'accounts': {'items': { + 'properties': {'creation_at': {'description': 'A ' + 'timestamp ' + 'defined ' + 'in ' + 'UTC', + 'format': 'date-time', + 'pattern': '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(\\.\\d+)?Z?', + 'type': 'string'}, + 'email_address': {'format': 'email', + 'pattern': '@example\\.com$', + 'type': 'string'}}, + 'type': 'object'}, + 'type': 'array'}, + 'email': {'format': 'email', + 'pattern': '@example\\.com$', + 'type': 'string'}, + 'timestamp': {'description': 'A timestamp defined in UTC', + 'format': 'date-time', + 'pattern': '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d(\\.\\d+)?Z?', + 'type': 'string'}}, "properties": { "name": { "type": "string",