diff --git a/103120/dictionaries/ts_103120_Dictionaries.schema.json b/103120/dictionaries/ts_103120_Dictionaries.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..d439cd6c3eba30a8024c1b50de613a4932e3075c --- /dev/null +++ b/103120/dictionaries/ts_103120_Dictionaries.schema.json @@ -0,0 +1,65 @@ +{ + "$id": "ts_103280_Dictionaries_2019_10", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$defs": { + "Dictionaries": { + "type": "object", + "properties": { + "dictionaries:Dictionary": { + "type": "array", + "items": { + "$ref": "#/$defs/Dictionary" + } + } + }, + "required": [] + }, + "Dictionary": { + "type": "object", + "properties": { + "dictionaries:Owner": { + "type": "string" + }, + "dictionaries:Name": { + "type": "string" + }, + "dictionaries:DictionaryEntries": { + "$ref": "#/$defs/DictionaryEntries" + } + }, + "required": [ + "dictionaries:Owner", + "dictionaries:Name", + "dictionaries:DictionaryEntries" + ] + }, + "DictionaryEntries": { + "type": "object", + "properties": { + "dictionaries:DictionaryEntry": { + "type": "array", + "items": { + "$ref": "#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, + "DictionaryEntry": { + "type": "object", + "properties": { + "dictionaries:Value": { + "type": "string" + }, + "dictionaries:Meaning": { + "type": "string" + } + }, + "required": [ + "dictionaries:Value", + "dictionaries:Meaning" + ] + } + }, + "$ref": "#/$defs/Dictionaries" +} diff --git a/utils/translate_spec.py b/utils/translate_spec.py index e950b4ae12cbd09066593774f8b560a2805cce4d..6c19f43f70a6a7e16f62dd4c4bff25312fd4dd14 100644 --- a/utils/translate_spec.py +++ b/utils/translate_spec.py @@ -89,7 +89,11 @@ if __name__ == "__main__": js['$defs']['HI1Message']['properties'].pop('xmldsig:Signature') js['$defs']['HI1Message']['properties']['Signature'] = json_signature_struct - js_path = output_path / convert_xsd_to_filename(schema_tuple[1]) + + if 'output' in ns_map[schema_tuple[0]]: + js_path = Path(ns_map[schema_tuple[0]]['output']) / convert_xsd_to_filename(schema_tuple[1]) + else: + js_path = output_path / convert_xsd_to_filename(schema_tuple[1]) # TODO - Special case - abstract HI1Object if "Core" in schema_tuple[1]: diff --git a/utils/ts103120_config.json b/utils/ts103120_config.json index 1bc79d1210797c752b7f81d3859c2509c868c706..00043ffc2d594bc62e0304b99e9215364eb94a1a 100644 --- a/utils/ts103120_config.json +++ b/utils/ts103120_config.json @@ -1,5 +1,9 @@ { "schemas" : { + "./103120/dictionaries/ts_103120_Dictionaries.xsd" : { + "prefix" : "dictionaries", + "output" : "./103120/dictionaries/" + }, "./103120/schema/xsd/ts_103120_Authorisation.xsd" : { "prefix" : "auth" },