From 4732d779a43a92c812051f0e10568f56e9680b49 Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 31 May 2024 09:20:11 +0100 Subject: [PATCH] Adding $schema keyword, newline and fixing enum --- .../json/ts_103120_Authorisation.schema.json | 7 +++++-- 103120/schema/json/ts_103120_Common.schema.json | 3 ++- 103120/schema/json/ts_103120_Core.schema.json | 3 ++- 103120/schema/json/ts_103120_Delivery.schema.json | 7 +++++-- 103120/schema/json/ts_103120_Document.schema.json | 7 +++++-- .../json/ts_103120_Notification.schema.json | 7 +++++-- 103120/schema/json/ts_103120_Task.schema.json | 15 +++++++++++---- .../json/ts_103120_TrafficPolicy.schema.json | 11 ++++++++--- utils/translate/SequenceMapping.py | 2 +- 9 files changed, 44 insertions(+), 18 deletions(-) diff --git a/103120/schema/json/ts_103120_Authorisation.schema.json b/103120/schema/json/ts_103120_Authorisation.schema.json index 1c9a68f..942438f 100644 --- a/103120/schema/json/ts_103120_Authorisation.schema.json +++ b/103120/schema/json/ts_103120_Authorisation.schema.json @@ -1,12 +1,15 @@ { "$id": "ts_103120_Authorisation_2020_09", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "AuthorisationObject": { "type": "object", "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -145,4 +148,4 @@ ] } } -} \ No newline at end of file +} diff --git a/103120/schema/json/ts_103120_Common.schema.json b/103120/schema/json/ts_103120_Common.schema.json index d11b4b4..c13f91b 100644 --- a/103120/schema/json/ts_103120_Common.schema.json +++ b/103120/schema/json/ts_103120_Common.schema.json @@ -1,5 +1,6 @@ { "$id": "ts_103120_Common_2016_02", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "ETSIVersion": { "allOf": [ @@ -161,4 +162,4 @@ ] } } -} \ No newline at end of file +} diff --git a/103120/schema/json/ts_103120_Core.schema.json b/103120/schema/json/ts_103120_Core.schema.json index 63e2ad4..71e583d 100644 --- a/103120/schema/json/ts_103120_Core.schema.json +++ b/103120/schema/json/ts_103120_Core.schema.json @@ -1,5 +1,6 @@ { "$id": "ts_103120_Core_2019_10", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "ObjectIdentifier": { "$ref": "ts_103280_2017_07#/$defs/UUID" @@ -603,4 +604,4 @@ } }, "$ref": "#/$defs/HI1Message" -} \ No newline at end of file +} diff --git a/103120/schema/json/ts_103120_Delivery.schema.json b/103120/schema/json/ts_103120_Delivery.schema.json index f87f7f5..8362950 100644 --- a/103120/schema/json/ts_103120_Delivery.schema.json +++ b/103120/schema/json/ts_103120_Delivery.schema.json @@ -1,12 +1,15 @@ { "$id": "ts_103120_Delivery_2019_10", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "DeliveryObject": { "type": "object", "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2019/10/Delivery}DeliveryObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2019/10/Delivery}DeliveryObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -229,4 +232,4 @@ "EmbeddedXMLData": {}, "EmbeddedJSONData": {} } -} \ No newline at end of file +} diff --git a/103120/schema/json/ts_103120_Document.schema.json b/103120/schema/json/ts_103120_Document.schema.json index d844092..3bc734c 100644 --- a/103120/schema/json/ts_103120_Document.schema.json +++ b/103120/schema/json/ts_103120_Document.schema.json @@ -1,12 +1,15 @@ { "$id": "ts_103120_Document_2020_09", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "DocumentObject": { "type": "object", "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2020/09/Document}DocumentObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2020/09/Document}DocumentObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -145,4 +148,4 @@ ] } } -} \ No newline at end of file +} diff --git a/103120/schema/json/ts_103120_Notification.schema.json b/103120/schema/json/ts_103120_Notification.schema.json index 84fbf04..aadb989 100644 --- a/103120/schema/json/ts_103120_Notification.schema.json +++ b/103120/schema/json/ts_103120_Notification.schema.json @@ -1,12 +1,15 @@ { "$id": "ts_103120_Notification_2016_02", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "NotificationObject": { "type": "object", "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2016/02/Notification}NotificationObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2016/02/Notification}NotificationObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -100,4 +103,4 @@ ] } } -} \ No newline at end of file +} diff --git a/103120/schema/json/ts_103120_Task.schema.json b/103120/schema/json/ts_103120_Task.schema.json index 5bb92ac..7df2c44 100644 --- a/103120/schema/json/ts_103120_Task.schema.json +++ b/103120/schema/json/ts_103120_Task.schema.json @@ -1,12 +1,15 @@ { "$id": "ts_103120_Task_2020_09", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "LITaskObject": { "type": "object", "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -372,7 +375,9 @@ "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2020/09/Task}LDTaskObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2020/09/Task}LDTaskObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -604,7 +609,9 @@ "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2020/09/Task}LPTaskObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2020/09/Task}LPTaskObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -720,4 +727,4 @@ "required": [] } } -} \ No newline at end of file +} diff --git a/103120/schema/json/ts_103120_TrafficPolicy.schema.json b/103120/schema/json/ts_103120_TrafficPolicy.schema.json index 18bb9cf..ef30cca 100644 --- a/103120/schema/json/ts_103120_TrafficPolicy.schema.json +++ b/103120/schema/json/ts_103120_TrafficPolicy.schema.json @@ -1,12 +1,15 @@ { "$id": "ts_103120_TrafficPolicy_2022_07", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$defs": { "TrafficPolicyObject": { "type": "object", "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2022/07/TrafficPolicy}TrafficPolicyObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2022/07/TrafficPolicy}TrafficPolicyObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -79,7 +82,9 @@ "properties": { "@xsi:type": { "type": "string", - "enum": "{http://uri.etsi.org/03120/common/2022/07/TrafficPolicy}TrafficRuleObject" + "enum": [ + "{http://uri.etsi.org/03120/common/2022/07/TrafficPolicy}TrafficRuleObject" + ] }, "ObjectIdentifier": { "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" @@ -307,4 +312,4 @@ ] } } -} \ No newline at end of file +} diff --git a/utils/translate/SequenceMapping.py b/utils/translate/SequenceMapping.py index 4dc5c93..341ac51 100644 --- a/utils/translate/SequenceMapping.py +++ b/utils/translate/SequenceMapping.py @@ -35,7 +35,7 @@ class SequenceMapping(ComplexTypeMapping): # mapped_type['__DESCENDENT_OF__'] = TypeMapping.get_ref_for(xst.base_type, xst.namespaces['']) mapped_type['properties']['@xsi:type'] = { "type" : "string", - "enum" : xst.name + "enum" : [xst.name] } mapped_type['required'].append('@xsi:type') # if xst.abstract: -- GitLab