From ec578ff9d5ba57537ec5c8adc75897cae0567add Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 31 May 2024 08:41:02 +0100 Subject: [PATCH] Adding $schema keyword to translation, as well as newline --- 103280/TS_103_280.schema.json | 1 + utils/translate/__init__.py | 1 + utils/translate_spec.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/103280/TS_103_280.schema.json b/103280/TS_103_280.schema.json index 458fdb92..555df4d2 100644 --- a/103280/TS_103_280.schema.json +++ b/103280/TS_103_280.schema.json @@ -1,5 +1,6 @@ { "$id": "ts_103280_2017_07", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "ShortString": { "type": "string", diff --git a/utils/translate/__init__.py b/utils/translate/__init__.py index ba05008f..86a33468 100644 --- a/utils/translate/__init__.py +++ b/utils/translate/__init__.py @@ -20,6 +20,7 @@ mappings = [ def translate_schema (schema_path: str, ns_to_id_map: dict, schema_locations = []): js = { "$id" : "?", + "$schema" : "https://json-schema.org/draft/2020-12/schema", "$defs" : {} } diff --git a/utils/translate_spec.py b/utils/translate_spec.py index 01880ff8..e950b4ae 100644 --- a/utils/translate_spec.py +++ b/utils/translate_spec.py @@ -107,7 +107,7 @@ if __name__ == "__main__": ] } - json_string = json.dumps(js, indent=2) + json_string = json.dumps(js, indent=2) + "\n" if "Core" in schema_tuple[1]: json_string = json_string.replace('"$ref": "#/$defs/HI1Object"', '"$ref": "#/$defs/ConcreteHI1Object"') -- GitLab