From 2a1e6ba674f5ce080e392a577f99e9ea8ffe10d4 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 10 Oct 2024 15:18:22 +0100 Subject: [PATCH 1/5] Translation fixes --- 103120/examples/json/request1_bad.json | 97 +++++++++++++++++++ .../json/request7-TrafficPolicyObject.json | 18 ++-- .../json/ts_103120_Authorisation.schema.json | 15 ++- .../schema/json/ts_103120_Common.schema.json | 24 +++-- 103120/schema/json/ts_103120_Core.schema.json | 83 +++++++++++----- .../json/ts_103120_Delivery.schema.json | 12 ++- .../json/ts_103120_Document.schema.json | 18 ++-- .../json/ts_103120_Notification.schema.json | 12 ++- 103120/schema/json/ts_103120_Task.schema.json | 84 ++++++++++------ .../json/ts_103120_TrafficPolicy.schema.json | 33 ++++--- utils/translate/ChoiceMapping.py | 4 +- utils/translate/SequenceMapping.py | 13 ++- utils/translate_spec.py | 3 +- 13 files changed, 310 insertions(+), 106 deletions(-) create mode 100644 103120/examples/json/request1_bad.json diff --git a/103120/examples/json/request1_bad.json b/103120/examples/json/request1_bad.json new file mode 100644 index 00000000..70fc486f --- /dev/null +++ b/103120/examples/json/request1_bad.json @@ -0,0 +1,97 @@ +{ + "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", + "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", + "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", + "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation", + "Header": { + "bad" : "bad", + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "c02358b2-76cf-4ba4-a8eb-f6436ccaea2e", + "Timestamp": "2015-09-01T12:00:00.000000Z", + "Version": { + "ETSIVersion": "V1.13.1", + "NationalProfileOwner": "XX", + "NationalProfileVersion": "v1.0" + } + }, + "Payload": { + "RequestPayload": { + "ActionRequests": { + "ActionRequest": [ + { + "ActionIdentifier": 0, + "CREATE": { + "HI1Object": { + "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject", + "ObjectIdentifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045", + "CountryCode": "XX", + "OwnerIdentifier": "ACTOR01", + "auth:AuthorisationReference": "W000001", + "auth:AuthorisationTimespan": { + "auth:StartTime": "2015-09-01T12:00:00Z", + "auth:EndTime": "2015-12-01T12:00:00Z" + } + } + } + }, + { + "ActionIdentifier": 1, + "CREATE": { + "HI1Object": { + "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject", + "ObjectIdentifier": "2b36a78b-b628-416d-bd22-404e68a0cd36", + "CountryCode": "XX", + "OwnerIdentifier": "ACTOR01", + "AssociatedObjects": { + "AssociatedObject": [ + "7dbbc880-8750-4d3c-abe7-ea4a17646045" + ] + }, + "task:Reference": "LIID1", + "task:TargetIdentifier": { + "task:TargetIdentifierValues": { + "task:TargetIdentifierValue": [ + { + "task:FormatType": { + "task:FormatOwner": "ETSI", + "task:FormatName": "InternationalE164" + }, + "task:Value": "442079460223" + } + ] + } + }, + "task:DeliveryType": { + "common:Owner": "ETSI", + "common:Name": "TaskDeliveryType", + "common:Value": "IRIandCC" + }, + "task:DeliveryDetails": { + "task:DeliveryDestination": [ + { + "task:DeliveryAddress": { + "task:IPv4Address": "192.0.2.0" + } + } + ] + }, + "task:CSPID": { + "CountryCode": "XX", + "UniqueIdentifier": "RECVER01" + } + } + } + } + ] + } + } + } +} diff --git a/103120/examples/json/request7-TrafficPolicyObject.json b/103120/examples/json/request7-TrafficPolicyObject.json index 09afd84e..0e6ca37d 100644 --- a/103120/examples/json/request7-TrafficPolicyObject.json +++ b/103120/examples/json/request7-TrafficPolicyObject.json @@ -2,7 +2,7 @@ "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", - "@xmlns:policy": "http://uri.etsi.org/03120/common/2022/07/TrafficPolicy", + "@xmlns:tp": "http://uri.etsi.org/03120/common/2022/07/TrafficPolicy", "@xmlns:etsi": "http://uri.etsi.org/03280/common/2017/07", "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", "Header": { @@ -34,16 +34,16 @@ "ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5", "CountryCode": "XX", "OwnerIdentifier": "ACTOR01", - "policy:Criteria": { - "policy:Criteria": { - "policy:IPPolicyCriteria": { - "policy:SourceIPRange": { + "tp:Criteria": { + "tp:Criteria": [{ + "tp:IPPolicyCriteria": { + "tp:SourceIPRange": { "etsi:IPv4CIDR": "203.0.113.0/24" } } - } + }] }, - "policy:Action": { + "tp:Action": { "common:Owner": "ETSI", "common:Name": "PolicyAction", "common:Value": "PDSR" @@ -59,8 +59,8 @@ "ObjectIdentifier": "55e25c0a-787b-4049-b7fb-518a13a9483b", "CountryCode": "XX", "OwnerIdentifier": "ACTOR01", - "policy:TrafficPolicyName": "Template Rule 1", - "policy:TrafficRules": { + "tp:TrafficPolicyName": "Template Rule 1", + "tp:TrafficRules": { "policy:TrafficRuleReference": { "policy:Order": "1", "policy:ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5" diff --git a/103120/schema/json/ts_103120_Authorisation.schema.json b/103120/schema/json/ts_103120_Authorisation.schema.json index 942438fa..0fc3e10f 100644 --- a/103120/schema/json/ts_103120_Authorisation.schema.json +++ b/103120/schema/json/ts_103120_Authorisation.schema.json @@ -97,7 +97,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "AuthorisationFlags": { "type": "object", @@ -109,7 +110,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "AuthorisationTimespan": { "type": "object", @@ -121,7 +123,8 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [] + "required": [], + "additionalProperties": false }, "AuthorisationCSPID": { "type": "object", @@ -134,7 +137,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "NationalAuthorisationParameters": { "type": "object", @@ -145,7 +149,8 @@ }, "required": [ "auth:CountryCode" - ] + ], + "additionalProperties": false } } } diff --git a/103120/schema/json/ts_103120_Common.schema.json b/103120/schema/json/ts_103120_Common.schema.json index d5c94ea2..21009361 100644 --- a/103120/schema/json/ts_103120_Common.schema.json +++ b/103120/schema/json/ts_103120_Common.schema.json @@ -23,7 +23,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "DictionaryEntry": { "type": "object", @@ -42,7 +43,8 @@ "common:Owner", "common:Name", "common:Value" - ] + ], + "additionalProperties": false }, "ApprovalDetails": { "type": "object", @@ -72,7 +74,8 @@ "$ref": "#/$defs/ApprovalNationalDetails" } }, - "required": [] + "required": [], + "additionalProperties": false }, "ApproverDetails": { "type": "object", @@ -93,7 +96,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "ApproverIdentity": { "oneOf": [ @@ -123,7 +127,8 @@ "$ref": "ts_103280_2017_07#/$defs/InternationalE164" } }, - "required": [] + "required": [], + "additionalProperties": false }, "NationalApproverIdentity": { "type": "object", @@ -134,7 +139,8 @@ }, "required": [ "common:CountryCode" - ] + ], + "additionalProperties": false }, "ApprovalDigitalSignature": { "oneOf": [ @@ -160,7 +166,8 @@ }, "required": [ "common:CountryCode" - ] + ], + "additionalProperties": false }, "NationalDigitalSignature": { "type": "object", @@ -171,7 +178,8 @@ }, "required": [ "common:CountryCode" - ] + ], + "additionalProperties": false } } } diff --git a/103120/schema/json/ts_103120_Core.schema.json b/103120/schema/json/ts_103120_Core.schema.json index 8ac79cfe..0b1d90f4 100644 --- a/103120/schema/json/ts_103120_Core.schema.json +++ b/103120/schema/json/ts_103120_Core.schema.json @@ -32,7 +32,13 @@ "required": [ "Header", "Payload" - ] + ], + "additionalProperties": false, + "patternProperties": { + "^@": { + "type": "string" + } + } }, "MessageHeader": { "type": "object", @@ -59,7 +65,8 @@ "TransactionIdentifier", "Timestamp", "Version" - ] + ], + "additionalProperties": false }, "Version": { "type": "object", @@ -78,7 +85,8 @@ "ETSIVersion", "NationalProfileOwner", "NationalProfileVersion" - ] + ], + "additionalProperties": false }, "EndpointID": { "type": "object", @@ -93,7 +101,8 @@ "required": [ "CountryCode", "UniqueIdentifier" - ] + ], + "additionalProperties": false }, "MessagePayload": { "oneOf": [ @@ -130,7 +139,8 @@ }, "required": [ "ActionRequests" - ] + ], + "additionalProperties": false }, "ActionRequests": { "type": "object", @@ -143,7 +153,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "ResponsePayload": { "oneOf": [ @@ -182,7 +193,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "ActionRequest": { "allOf": [ @@ -268,7 +280,8 @@ } ] } - ] + ], + "unevaluatedProperties": false }, "ActionResponse": { "allOf": [ @@ -365,7 +378,8 @@ } ] } - ] + ], + "unevaluatedProperties": false }, "GETRequest": { "type": "object", @@ -376,7 +390,8 @@ }, "required": [ "Identifier" - ] + ], + "additionalProperties": false }, "GETResponse": { "type": "object", @@ -387,7 +402,8 @@ }, "required": [ "HI1Object" - ] + ], + "additionalProperties": false }, "CREATERequest": { "type": "object", @@ -398,7 +414,8 @@ }, "required": [ "HI1Object" - ] + ], + "additionalProperties": false }, "CREATEResponse": { "type": "object", @@ -412,7 +429,8 @@ }, "required": [ "Identifier" - ] + ], + "additionalProperties": false }, "UPDATERequest": { "type": "object", @@ -423,7 +441,8 @@ }, "required": [ "HI1Object" - ] + ], + "additionalProperties": false }, "UPDATEResponse": { "type": "object", @@ -437,7 +456,8 @@ }, "required": [ "Identifier" - ] + ], + "additionalProperties": false }, "LISTRequest": { "type": "object", @@ -449,7 +469,8 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [] + "required": [], + "additionalProperties": false }, "LISTResponse": { "type": "object", @@ -461,7 +482,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "ListResponseRecord": { "type": "object", @@ -493,7 +515,8 @@ "ObjectType", "Identifier", "Generation" - ] + ], + "additionalProperties": false }, "ActionUnsuccesfulInformation": { "type": "object", @@ -509,7 +532,8 @@ "required": [ "ErrorCode", "ErrorDescription" - ] + ], + "additionalProperties": false }, "DELIVERRequest": { "type": "object", @@ -524,7 +548,8 @@ "required": [ "Identifier", "HI1Object" - ] + ], + "additionalProperties": false }, "DELIVERResponse": { "type": "object", @@ -535,12 +560,14 @@ }, "required": [ "Identifier" - ] + ], + "additionalProperties": false }, "GETCSPCONFIGRequest": { "type": "object", "properties": {}, - "required": [] + "required": [], + "additionalProperties": false }, "GETCSPCONFIGResponse": { "type": "object", @@ -565,7 +592,8 @@ "required": [ "LastChanged", "TargetingConfigurations" - ] + ], + "additionalProperties": false }, "HI1Object": { "type": "object", @@ -598,7 +626,8 @@ }, "required": [ "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "AssociatedObjects": { "type": "object", @@ -610,7 +639,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "NationalHandlingParameters": { "type": "object", @@ -621,7 +651,8 @@ }, "required": [ "CountryCode" - ] + ], + "additionalProperties": false }, "ConcreteHI1Object": { "oneOf": [ diff --git a/103120/schema/json/ts_103120_Delivery.schema.json b/103120/schema/json/ts_103120_Delivery.schema.json index 6b417629..6ca0ffa2 100644 --- a/103120/schema/json/ts_103120_Delivery.schema.json +++ b/103120/schema/json/ts_103120_Delivery.schema.json @@ -65,7 +65,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "Reference": { "oneOf": [ @@ -129,7 +130,8 @@ "$ref": "#/$defs/ManifestContents" } }, - "required": [] + "required": [], + "additionalProperties": false }, "ManifestContents": { "oneOf": [ @@ -175,7 +177,8 @@ }, "required": [ "delivery:schema" - ] + ], + "additionalProperties": false }, "Delivery": { "oneOf": [ @@ -236,7 +239,8 @@ }, "required": [ "delivery:Data" - ] + ], + "additionalProperties": false }, "ListOfChecksumAndType": { "type": "object", diff --git a/103120/schema/json/ts_103120_Document.schema.json b/103120/schema/json/ts_103120_Document.schema.json index 3bc734ca..5adf5aa0 100644 --- a/103120/schema/json/ts_103120_Document.schema.json +++ b/103120/schema/json/ts_103120_Document.schema.json @@ -76,7 +76,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "DocumentTimespan": { "type": "object", @@ -88,7 +89,8 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [] + "required": [], + "additionalProperties": false }, "DocumentProperties": { "type": "object", @@ -100,7 +102,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "DocumentProperty": { "type": "object", @@ -115,7 +118,8 @@ "required": [ "doc:PropertyType", "doc:PropertyValue" - ] + ], + "additionalProperties": false }, "DocumentBody": { "type": "object", @@ -134,7 +138,8 @@ "$ref": "ts_103280_2017_07#/$defs/ShortString" } }, - "required": [] + "required": [], + "additionalProperties": false }, "NationalDocumentParameters": { "type": "object", @@ -145,7 +150,8 @@ }, "required": [ "doc:CountryCode" - ] + ], + "additionalProperties": false } } } diff --git a/103120/schema/json/ts_103120_Notification.schema.json b/103120/schema/json/ts_103120_Notification.schema.json index aadb9890..3654fa3e 100644 --- a/103120/schema/json/ts_103120_Notification.schema.json +++ b/103120/schema/json/ts_103120_Notification.schema.json @@ -58,7 +58,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "ListOfAssociatedObjectStatus": { "type": "object", @@ -71,7 +72,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "AssociatedObjectStatus": { "type": "object", @@ -89,7 +91,8 @@ "required": [ "notification:AssociatedObject", "notification:Status" - ] + ], + "additionalProperties": false }, "NationalNotificationParameters": { "type": "object", @@ -100,7 +103,8 @@ }, "required": [ "notification:CountryCode" - ] + ], + "additionalProperties": false } } } diff --git a/103120/schema/json/ts_103120_Task.schema.json b/103120/schema/json/ts_103120_Task.schema.json index fc2ad0c0..5ced7ab9 100644 --- a/103120/schema/json/ts_103120_Task.schema.json +++ b/103120/schema/json/ts_103120_Task.schema.json @@ -85,7 +85,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "TaskTimespan": { "type": "object", @@ -106,7 +107,8 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [] + "required": [], + "additionalProperties": false }, "TargetIdentifier": { "type": "object", @@ -121,7 +123,8 @@ "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" } }, - "required": [] + "required": [], + "additionalProperties": false }, "TargetIdentifierValues": { "type": "object", @@ -134,7 +137,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "TargetIdentifierValue": { "type": "object", @@ -149,7 +153,8 @@ "required": [ "task:FormatType", "task:Value" - ] + ], + "additionalProperties": false }, "FormatType": { "type": "object", @@ -164,7 +169,8 @@ "required": [ "task:FormatOwner", "task:FormatName" - ] + ], + "additionalProperties": false }, "TaskDeliveryDetails": { "type": "object", @@ -177,7 +183,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "DeliveryDestination": { "type": "object", @@ -201,7 +208,8 @@ "$ref": "#/$defs/NationalDeliveryParameters" } }, - "required": [] + "required": [], + "additionalProperties": false }, "DeliveryAddress": { "oneOf": [ @@ -338,7 +346,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "NationalLITaskingParameters": { "type": "object", @@ -349,7 +358,8 @@ }, "required": [ "task:CountryCode" - ] + ], + "additionalProperties": false }, "NationalDeliveryParameters": { "type": "object", @@ -360,7 +370,8 @@ }, "required": [ "task:CountryCode" - ] + ], + "additionalProperties": false }, "NationalEncryptionDetails": { "type": "object", @@ -371,7 +382,8 @@ }, "required": [ "task:CountryCode" - ] + ], + "additionalProperties": false }, "LDTaskObject": { "type": "object", @@ -450,7 +462,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "RequestDetails": { "type": "object", @@ -483,7 +496,8 @@ "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" } }, - "required": [] + "required": [], + "additionalProperties": false }, "RequestValues": { "type": "object", @@ -496,7 +510,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "RequestValue": { "type": "object", @@ -511,7 +526,8 @@ "required": [ "task:FormatType", "task:Value" - ] + ], + "additionalProperties": false }, "RequestSubtype": { "type": "object", @@ -524,7 +540,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "LDDeliveryDetails": { "type": "object", @@ -537,7 +554,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "LDDeliveryDestination": { "type": "object", @@ -558,7 +576,8 @@ "$ref": "#/$defs/NationalDeliveryParameters" } }, - "required": [] + "required": [], + "additionalProperties": false }, "LDTaskFlags": { "type": "object", @@ -570,7 +589,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "ListOfAlternativePreservationReferences": { "type": "object", @@ -583,7 +603,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "AlternativePreservationReference": { "type": "object", @@ -597,7 +618,8 @@ }, "required": [ "task:ReferenceValue" - ] + ], + "additionalProperties": false }, "NationalLDTaskingParameters": { "type": "object", @@ -608,7 +630,8 @@ }, "required": [ "task:CountryCode" - ] + ], + "additionalProperties": false }, "LPTaskObject": { "type": "object", @@ -672,7 +695,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "LPRequestDetails": { "type": "object", @@ -693,7 +717,8 @@ "$ref": "#/$defs/RequestSubtype" } }, - "required": [] + "required": [], + "additionalProperties": false }, "NationalLPTaskingParameters": { "type": "object", @@ -704,7 +729,8 @@ }, "required": [ "task:CountryCode" - ] + ], + "additionalProperties": false }, "ListOfTrafficPolicyReferences": { "type": "object", @@ -717,7 +743,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "TrafficPolicyReference": { "type": "object", @@ -730,7 +757,8 @@ "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" } }, - "required": [] + "required": [], + "additionalProperties": false } } } diff --git a/103120/schema/json/ts_103120_TrafficPolicy.schema.json b/103120/schema/json/ts_103120_TrafficPolicy.schema.json index ef30ccae..b209a838 100644 --- a/103120/schema/json/ts_103120_TrafficPolicy.schema.json +++ b/103120/schema/json/ts_103120_TrafficPolicy.schema.json @@ -46,7 +46,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "ListOfTrafficRuleReferences": { "type": "object", @@ -59,7 +60,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "TrafficRuleReference": { "type": "object", @@ -75,7 +77,8 @@ "required": [ "tp:Order", "tp:ObjectIdentifier" - ] + ], + "additionalProperties": false }, "TrafficRuleObject": { "type": "object", @@ -124,7 +127,8 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ] + ], + "additionalProperties": false }, "ListOfTrafficCriteria": { "type": "object", @@ -137,7 +141,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "TrafficCriteria": { "oneOf": [ @@ -210,7 +215,8 @@ "type": "boolean" } }, - "required": [] + "required": [], + "additionalProperties": false }, "MobileAccessPolicyCriteria": { "type": "object", @@ -222,7 +228,8 @@ "$ref": "ts_103280_2017_07#/$defs/ShortString" } }, - "required": [] + "required": [], + "additionalProperties": false }, "EthernetPolicyCriteria": { "type": "object", @@ -240,7 +247,8 @@ "$ref": "#/$defs/VLANCriteria" } }, - "required": [] + "required": [], + "additionalProperties": false }, "VLANCriteria": { "oneOf": [ @@ -268,7 +276,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "RCSPolicyCriteria": { "type": "object", @@ -279,7 +288,8 @@ }, "required": [ "tp:CommunicationServiceID" - ] + ], + "additionalProperties": false }, "ActionParameters": { "oneOf": [ @@ -309,7 +319,8 @@ }, "required": [ "tp:NumberOfOctets" - ] + ], + "additionalProperties": false } } } diff --git a/utils/translate/ChoiceMapping.py b/utils/translate/ChoiceMapping.py index b477a336..052bd45e 100644 --- a/utils/translate/ChoiceMapping.py +++ b/utils/translate/ChoiceMapping.py @@ -44,4 +44,6 @@ class ChoiceMapping(ComplexTypeMapping): if (content.model != 'choice'): log.debug("Not a choice, giving up") return None - return { 'oneOf' : ChoiceMapping.process_choice(content, xst.namespaces[''], self.ns_to_id_map)} + return { + 'oneOf' : ChoiceMapping.process_choice(content, xst.namespaces[''], self.ns_to_id_map) + } diff --git a/utils/translate/SequenceMapping.py b/utils/translate/SequenceMapping.py index 341ac514..9932c466 100644 --- a/utils/translate/SequenceMapping.py +++ b/utils/translate/SequenceMapping.py @@ -26,7 +26,8 @@ class SequenceMapping(ComplexTypeMapping): mapped_type = { 'type' : 'object', 'properties' : {}, - 'required' : [] + 'required' : [], + 'additionalProperties' : False, } # Not going to try and do all of this automatically for now @@ -75,11 +76,17 @@ class SequenceMapping(ComplexTypeMapping): else: raise Exception(f"Unknown element type {c}") if (inner_choice): + for inner_thing in inner_choice: + inner_thing.pop('additionalProperties', None) + mapped_type.pop('additionalProperties', None) return { 'allOf' : [ mapped_type, - {'oneOf' : inner_choice} - ] + { + 'oneOf' : inner_choice + } + ], + 'unevaluatedProperties' : False } else: return mapped_type diff --git a/utils/translate_spec.py b/utils/translate_spec.py index e950b4ae..f2008595 100644 --- a/utils/translate_spec.py +++ b/utils/translate_spec.py @@ -83,9 +83,10 @@ if __name__ == "__main__": continue js = translate_schema(schema_tuple[1], ns_map, schema_locations) - # TODO - Special case, get rid of XML Dsig signature and insert JSON signature + # Special case, get rid of XML Dsig signature and insert JSON signature, and XML attrib pattern property if schema_tuple[0] == 'http://uri.etsi.org/03120/common/2019/10/Core': logging.info ("Modifying signature elements") + js['$defs']['HI1Message']['patternProperties'] = { "^@" : { "type" : "string"}} js['$defs']['HI1Message']['properties'].pop('xmldsig:Signature') js['$defs']['HI1Message']['properties']['Signature'] = json_signature_struct -- GitLab From 2f3892a8d55d6234e089f7900def15afc18020da Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 14 Oct 2024 12:38:06 +0100 Subject: [PATCH 2/5] Hack to fix TP criteria coercion to list --- .../json/request7-TrafficPolicyObject.json | 31 ++++++++---- .../xml/request7_TrafficPolicyObject.xml | 49 +++++++++++-------- 103280/TS_103_280.schema.json | 2 +- utils/xml_to_json.py | 25 +++++++++- 4 files changed, 73 insertions(+), 34 deletions(-) diff --git a/103120/examples/json/request7-TrafficPolicyObject.json b/103120/examples/json/request7-TrafficPolicyObject.json index 0e6ca37d..be0fc884 100644 --- a/103120/examples/json/request7-TrafficPolicyObject.json +++ b/103120/examples/json/request7-TrafficPolicyObject.json @@ -3,7 +3,7 @@ "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", "@xmlns:tp": "http://uri.etsi.org/03120/common/2022/07/TrafficPolicy", - "@xmlns:etsi": "http://uri.etsi.org/03280/common/2017/07", + "@xmlns:etsi280": "http://uri.etsi.org/03280/common/2017/07", "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", "Header": { "SenderIdentifier": { @@ -35,13 +35,22 @@ "CountryCode": "XX", "OwnerIdentifier": "ACTOR01", "tp:Criteria": { - "tp:Criteria": [{ - "tp:IPPolicyCriteria": { - "tp:SourceIPRange": { - "etsi:IPv4CIDR": "203.0.113.0/24" + "tp:Criteria": [ + { + "tp:IPPolicyCriteria": { + "tp:SourceIPRange": { + "etsi280:IPv4CIDR": "203.0.113.0/24" + } + } + }, + { + "tp:IPPolicyCriteria": { + "tp:SourceIPRange": { + "etsi280:IPv4CIDR": "203.0.113.0/24" + } } } - }] + ] }, "tp:Action": { "common:Owner": "ETSI", @@ -61,10 +70,12 @@ "OwnerIdentifier": "ACTOR01", "tp:TrafficPolicyName": "Template Rule 1", "tp:TrafficRules": { - "policy:TrafficRuleReference": { - "policy:Order": "1", - "policy:ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5" - } + "tp:TrafficRuleReference": [ + { + "tp:Order": 1, + "tp:ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5" + } + ] } } } diff --git a/103120/examples/xml/request7_TrafficPolicyObject.xml b/103120/examples/xml/request7_TrafficPolicyObject.xml index 7ee2e5ef..bbcd6881 100644 --- a/103120/examples/xml/request7_TrafficPolicyObject.xml +++ b/103120/examples/xml/request7_TrafficPolicyObject.xml @@ -1,5 +1,5 @@ - +
XX @@ -23,41 +23,48 @@ 0 - + f69eb93b-a85b-4ff7-abaa-6f3aead286d5 XX ACTOR01 - - - - - 203.0.113.0/24 - - - - - + + + + + 203.0.113.0/24 + + + + + + + 203.0.113.0/24 + + + + + ETSI PolicyAction PDSR - + 1 - + 55e25c0a-787b-4049-b7fb-518a13a9483b XX ACTOR01 - Template Rule 1 - - - 1 - f69eb93b-a85b-4ff7-abaa-6f3aead286d5 - - + Template Rule 1 + + + 1 + f69eb93b-a85b-4ff7-abaa-6f3aead286d5 + + diff --git a/103280/TS_103_280.schema.json b/103280/TS_103_280.schema.json index aa63f818..b6824a99 100644 --- a/103280/TS_103_280.schema.json +++ b/103280/TS_103_280.schema.json @@ -56,7 +56,7 @@ }, "IPv4CIDR": { "type": "string", - "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/([1-2]?[0-9]|3[0-2])$" + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\/([1-2]?[0-9]|3[0-2])$" }, "IPv6Address": { "type": "string", diff --git a/utils/xml_to_json.py b/utils/xml_to_json.py index 86f8ad7e..e9609c79 100644 --- a/utils/xml_to_json.py +++ b/utils/xml_to_json.py @@ -80,6 +80,7 @@ coerce_to_int = [ 'task:Order', 'ErrorCode', 'Generation', + 'tp:Order' ] coerce_to_bool = [ @@ -115,6 +116,20 @@ def postprocessor (path, key, value): return key, {} return key, value +def recursively_fix_tpcriteria (d: dict): + if isinstance(d, dict): + if ("tp:Criteria" in d + and isinstance(d["tp:Criteria"], list) + and len(d["tp:Criteria"]) == 1 + ): + d["tp:Criteria"] = d["tp:Criteria"][0] + else: + for k,v in d.items(): + recursively_fix_tpcriteria(v) + elif isinstance(d, list): + for d_item in d: + recursively_fix_tpcriteria(d_item) + if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('-v', '--verbose', action='count', help='Verbose logging (can be specified multiple times)') @@ -132,7 +147,7 @@ if __name__ == "__main__": logging.debug(f"Arguments: {args}") s = args.input.read() - args.input.close() + args.input.close() logging.debug(s) @@ -141,4 +156,10 @@ if __name__ == "__main__": postprocessor=postprocessor )['HI1Message'] - print(json.dumps(d, indent=2)) + # HACK + # Needed because TrafficPolicy.xsd has two nested fields both called tp:Criteria + # but only the outer one needs to be coerced into a list + recursively_fix_tpcriteria(d) + out_str = json.dumps(d, indent=2) + + print(out_str) -- GitLab From d1a5e7aa8d39828d256daadfa91e08c2b7f8ce4a Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 6 Feb 2025 12:28:58 +0000 Subject: [PATCH 3/5] Reverting 120 changes --- 103120/examples/json/request1_bad.json | 97 ------------------- .../json/request7-TrafficPolicyObject.json | 41 +++----- .../xml/request7_TrafficPolicyObject.xml | 49 ++++------ .../json/ts_103120_Authorisation.schema.json | 15 +-- .../schema/json/ts_103120_Common.schema.json | 24 ++--- 103120/schema/json/ts_103120_Core.schema.json | 83 +++++----------- .../json/ts_103120_Delivery.schema.json | 12 +-- .../json/ts_103120_Document.schema.json | 18 ++-- .../json/ts_103120_Notification.schema.json | 12 +-- 103120/schema/json/ts_103120_Task.schema.json | 84 ++++++---------- .../json/ts_103120_TrafficPolicy.schema.json | 33 +++---- 11 files changed, 128 insertions(+), 340 deletions(-) delete mode 100644 103120/examples/json/request1_bad.json diff --git a/103120/examples/json/request1_bad.json b/103120/examples/json/request1_bad.json deleted file mode 100644 index 70fc486f..00000000 --- a/103120/examples/json/request1_bad.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", - "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", - "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", - "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", - "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation", - "Header": { - "bad" : "bad", - "SenderIdentifier": { - "CountryCode": "XX", - "UniqueIdentifier": "ACTOR01" - }, - "ReceiverIdentifier": { - "CountryCode": "XX", - "UniqueIdentifier": "ACTOR02" - }, - "TransactionIdentifier": "c02358b2-76cf-4ba4-a8eb-f6436ccaea2e", - "Timestamp": "2015-09-01T12:00:00.000000Z", - "Version": { - "ETSIVersion": "V1.13.1", - "NationalProfileOwner": "XX", - "NationalProfileVersion": "v1.0" - } - }, - "Payload": { - "RequestPayload": { - "ActionRequests": { - "ActionRequest": [ - { - "ActionIdentifier": 0, - "CREATE": { - "HI1Object": { - "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject", - "ObjectIdentifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045", - "CountryCode": "XX", - "OwnerIdentifier": "ACTOR01", - "auth:AuthorisationReference": "W000001", - "auth:AuthorisationTimespan": { - "auth:StartTime": "2015-09-01T12:00:00Z", - "auth:EndTime": "2015-12-01T12:00:00Z" - } - } - } - }, - { - "ActionIdentifier": 1, - "CREATE": { - "HI1Object": { - "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject", - "ObjectIdentifier": "2b36a78b-b628-416d-bd22-404e68a0cd36", - "CountryCode": "XX", - "OwnerIdentifier": "ACTOR01", - "AssociatedObjects": { - "AssociatedObject": [ - "7dbbc880-8750-4d3c-abe7-ea4a17646045" - ] - }, - "task:Reference": "LIID1", - "task:TargetIdentifier": { - "task:TargetIdentifierValues": { - "task:TargetIdentifierValue": [ - { - "task:FormatType": { - "task:FormatOwner": "ETSI", - "task:FormatName": "InternationalE164" - }, - "task:Value": "442079460223" - } - ] - } - }, - "task:DeliveryType": { - "common:Owner": "ETSI", - "common:Name": "TaskDeliveryType", - "common:Value": "IRIandCC" - }, - "task:DeliveryDetails": { - "task:DeliveryDestination": [ - { - "task:DeliveryAddress": { - "task:IPv4Address": "192.0.2.0" - } - } - ] - }, - "task:CSPID": { - "CountryCode": "XX", - "UniqueIdentifier": "RECVER01" - } - } - } - } - ] - } - } - } -} diff --git a/103120/examples/json/request7-TrafficPolicyObject.json b/103120/examples/json/request7-TrafficPolicyObject.json index be0fc884..09afd84e 100644 --- a/103120/examples/json/request7-TrafficPolicyObject.json +++ b/103120/examples/json/request7-TrafficPolicyObject.json @@ -2,8 +2,8 @@ "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", - "@xmlns:tp": "http://uri.etsi.org/03120/common/2022/07/TrafficPolicy", - "@xmlns:etsi280": "http://uri.etsi.org/03280/common/2017/07", + "@xmlns:policy": "http://uri.etsi.org/03120/common/2022/07/TrafficPolicy", + "@xmlns:etsi": "http://uri.etsi.org/03280/common/2017/07", "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", "Header": { "SenderIdentifier": { @@ -34,25 +34,16 @@ "ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5", "CountryCode": "XX", "OwnerIdentifier": "ACTOR01", - "tp:Criteria": { - "tp:Criteria": [ - { - "tp:IPPolicyCriteria": { - "tp:SourceIPRange": { - "etsi280:IPv4CIDR": "203.0.113.0/24" - } - } - }, - { - "tp:IPPolicyCriteria": { - "tp:SourceIPRange": { - "etsi280:IPv4CIDR": "203.0.113.0/24" - } + "policy:Criteria": { + "policy:Criteria": { + "policy:IPPolicyCriteria": { + "policy:SourceIPRange": { + "etsi:IPv4CIDR": "203.0.113.0/24" } } - ] + } }, - "tp:Action": { + "policy:Action": { "common:Owner": "ETSI", "common:Name": "PolicyAction", "common:Value": "PDSR" @@ -68,14 +59,12 @@ "ObjectIdentifier": "55e25c0a-787b-4049-b7fb-518a13a9483b", "CountryCode": "XX", "OwnerIdentifier": "ACTOR01", - "tp:TrafficPolicyName": "Template Rule 1", - "tp:TrafficRules": { - "tp:TrafficRuleReference": [ - { - "tp:Order": 1, - "tp:ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5" - } - ] + "policy:TrafficPolicyName": "Template Rule 1", + "policy:TrafficRules": { + "policy:TrafficRuleReference": { + "policy:Order": "1", + "policy:ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5" + } } } } diff --git a/103120/examples/xml/request7_TrafficPolicyObject.xml b/103120/examples/xml/request7_TrafficPolicyObject.xml index bbcd6881..7ee2e5ef 100644 --- a/103120/examples/xml/request7_TrafficPolicyObject.xml +++ b/103120/examples/xml/request7_TrafficPolicyObject.xml @@ -1,5 +1,5 @@ - +
XX @@ -23,48 +23,41 @@ 0 - + f69eb93b-a85b-4ff7-abaa-6f3aead286d5 XX ACTOR01 - - - - - 203.0.113.0/24 - - - - - - - 203.0.113.0/24 - - - - - + + + + + 203.0.113.0/24 + + + + + ETSI PolicyAction PDSR - + 1 - + 55e25c0a-787b-4049-b7fb-518a13a9483b XX ACTOR01 - Template Rule 1 - - - 1 - f69eb93b-a85b-4ff7-abaa-6f3aead286d5 - - + Template Rule 1 + + + 1 + f69eb93b-a85b-4ff7-abaa-6f3aead286d5 + + diff --git a/103120/schema/json/ts_103120_Authorisation.schema.json b/103120/schema/json/ts_103120_Authorisation.schema.json index 0fc3e10f..942438fa 100644 --- a/103120/schema/json/ts_103120_Authorisation.schema.json +++ b/103120/schema/json/ts_103120_Authorisation.schema.json @@ -97,8 +97,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "AuthorisationFlags": { "type": "object", @@ -110,8 +109,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "AuthorisationTimespan": { "type": "object", @@ -123,8 +121,7 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [], - "additionalProperties": false + "required": [] }, "AuthorisationCSPID": { "type": "object", @@ -137,8 +134,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "NationalAuthorisationParameters": { "type": "object", @@ -149,8 +145,7 @@ }, "required": [ "auth:CountryCode" - ], - "additionalProperties": false + ] } } } diff --git a/103120/schema/json/ts_103120_Common.schema.json b/103120/schema/json/ts_103120_Common.schema.json index 21009361..d5c94ea2 100644 --- a/103120/schema/json/ts_103120_Common.schema.json +++ b/103120/schema/json/ts_103120_Common.schema.json @@ -23,8 +23,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "DictionaryEntry": { "type": "object", @@ -43,8 +42,7 @@ "common:Owner", "common:Name", "common:Value" - ], - "additionalProperties": false + ] }, "ApprovalDetails": { "type": "object", @@ -74,8 +72,7 @@ "$ref": "#/$defs/ApprovalNationalDetails" } }, - "required": [], - "additionalProperties": false + "required": [] }, "ApproverDetails": { "type": "object", @@ -96,8 +93,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "ApproverIdentity": { "oneOf": [ @@ -127,8 +123,7 @@ "$ref": "ts_103280_2017_07#/$defs/InternationalE164" } }, - "required": [], - "additionalProperties": false + "required": [] }, "NationalApproverIdentity": { "type": "object", @@ -139,8 +134,7 @@ }, "required": [ "common:CountryCode" - ], - "additionalProperties": false + ] }, "ApprovalDigitalSignature": { "oneOf": [ @@ -166,8 +160,7 @@ }, "required": [ "common:CountryCode" - ], - "additionalProperties": false + ] }, "NationalDigitalSignature": { "type": "object", @@ -178,8 +171,7 @@ }, "required": [ "common:CountryCode" - ], - "additionalProperties": false + ] } } } diff --git a/103120/schema/json/ts_103120_Core.schema.json b/103120/schema/json/ts_103120_Core.schema.json index 0b1d90f4..8ac79cfe 100644 --- a/103120/schema/json/ts_103120_Core.schema.json +++ b/103120/schema/json/ts_103120_Core.schema.json @@ -32,13 +32,7 @@ "required": [ "Header", "Payload" - ], - "additionalProperties": false, - "patternProperties": { - "^@": { - "type": "string" - } - } + ] }, "MessageHeader": { "type": "object", @@ -65,8 +59,7 @@ "TransactionIdentifier", "Timestamp", "Version" - ], - "additionalProperties": false + ] }, "Version": { "type": "object", @@ -85,8 +78,7 @@ "ETSIVersion", "NationalProfileOwner", "NationalProfileVersion" - ], - "additionalProperties": false + ] }, "EndpointID": { "type": "object", @@ -101,8 +93,7 @@ "required": [ "CountryCode", "UniqueIdentifier" - ], - "additionalProperties": false + ] }, "MessagePayload": { "oneOf": [ @@ -139,8 +130,7 @@ }, "required": [ "ActionRequests" - ], - "additionalProperties": false + ] }, "ActionRequests": { "type": "object", @@ -153,8 +143,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "ResponsePayload": { "oneOf": [ @@ -193,8 +182,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "ActionRequest": { "allOf": [ @@ -280,8 +268,7 @@ } ] } - ], - "unevaluatedProperties": false + ] }, "ActionResponse": { "allOf": [ @@ -378,8 +365,7 @@ } ] } - ], - "unevaluatedProperties": false + ] }, "GETRequest": { "type": "object", @@ -390,8 +376,7 @@ }, "required": [ "Identifier" - ], - "additionalProperties": false + ] }, "GETResponse": { "type": "object", @@ -402,8 +387,7 @@ }, "required": [ "HI1Object" - ], - "additionalProperties": false + ] }, "CREATERequest": { "type": "object", @@ -414,8 +398,7 @@ }, "required": [ "HI1Object" - ], - "additionalProperties": false + ] }, "CREATEResponse": { "type": "object", @@ -429,8 +412,7 @@ }, "required": [ "Identifier" - ], - "additionalProperties": false + ] }, "UPDATERequest": { "type": "object", @@ -441,8 +423,7 @@ }, "required": [ "HI1Object" - ], - "additionalProperties": false + ] }, "UPDATEResponse": { "type": "object", @@ -456,8 +437,7 @@ }, "required": [ "Identifier" - ], - "additionalProperties": false + ] }, "LISTRequest": { "type": "object", @@ -469,8 +449,7 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [], - "additionalProperties": false + "required": [] }, "LISTResponse": { "type": "object", @@ -482,8 +461,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "ListResponseRecord": { "type": "object", @@ -515,8 +493,7 @@ "ObjectType", "Identifier", "Generation" - ], - "additionalProperties": false + ] }, "ActionUnsuccesfulInformation": { "type": "object", @@ -532,8 +509,7 @@ "required": [ "ErrorCode", "ErrorDescription" - ], - "additionalProperties": false + ] }, "DELIVERRequest": { "type": "object", @@ -548,8 +524,7 @@ "required": [ "Identifier", "HI1Object" - ], - "additionalProperties": false + ] }, "DELIVERResponse": { "type": "object", @@ -560,14 +535,12 @@ }, "required": [ "Identifier" - ], - "additionalProperties": false + ] }, "GETCSPCONFIGRequest": { "type": "object", "properties": {}, - "required": [], - "additionalProperties": false + "required": [] }, "GETCSPCONFIGResponse": { "type": "object", @@ -592,8 +565,7 @@ "required": [ "LastChanged", "TargetingConfigurations" - ], - "additionalProperties": false + ] }, "HI1Object": { "type": "object", @@ -626,8 +598,7 @@ }, "required": [ "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "AssociatedObjects": { "type": "object", @@ -639,8 +610,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "NationalHandlingParameters": { "type": "object", @@ -651,8 +621,7 @@ }, "required": [ "CountryCode" - ], - "additionalProperties": false + ] }, "ConcreteHI1Object": { "oneOf": [ diff --git a/103120/schema/json/ts_103120_Delivery.schema.json b/103120/schema/json/ts_103120_Delivery.schema.json index 6ca0ffa2..6b417629 100644 --- a/103120/schema/json/ts_103120_Delivery.schema.json +++ b/103120/schema/json/ts_103120_Delivery.schema.json @@ -65,8 +65,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "Reference": { "oneOf": [ @@ -130,8 +129,7 @@ "$ref": "#/$defs/ManifestContents" } }, - "required": [], - "additionalProperties": false + "required": [] }, "ManifestContents": { "oneOf": [ @@ -177,8 +175,7 @@ }, "required": [ "delivery:schema" - ], - "additionalProperties": false + ] }, "Delivery": { "oneOf": [ @@ -239,8 +236,7 @@ }, "required": [ "delivery:Data" - ], - "additionalProperties": false + ] }, "ListOfChecksumAndType": { "type": "object", diff --git a/103120/schema/json/ts_103120_Document.schema.json b/103120/schema/json/ts_103120_Document.schema.json index 5adf5aa0..3bc734ca 100644 --- a/103120/schema/json/ts_103120_Document.schema.json +++ b/103120/schema/json/ts_103120_Document.schema.json @@ -76,8 +76,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "DocumentTimespan": { "type": "object", @@ -89,8 +88,7 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [], - "additionalProperties": false + "required": [] }, "DocumentProperties": { "type": "object", @@ -102,8 +100,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "DocumentProperty": { "type": "object", @@ -118,8 +115,7 @@ "required": [ "doc:PropertyType", "doc:PropertyValue" - ], - "additionalProperties": false + ] }, "DocumentBody": { "type": "object", @@ -138,8 +134,7 @@ "$ref": "ts_103280_2017_07#/$defs/ShortString" } }, - "required": [], - "additionalProperties": false + "required": [] }, "NationalDocumentParameters": { "type": "object", @@ -150,8 +145,7 @@ }, "required": [ "doc:CountryCode" - ], - "additionalProperties": false + ] } } } diff --git a/103120/schema/json/ts_103120_Notification.schema.json b/103120/schema/json/ts_103120_Notification.schema.json index 3654fa3e..aadb9890 100644 --- a/103120/schema/json/ts_103120_Notification.schema.json +++ b/103120/schema/json/ts_103120_Notification.schema.json @@ -58,8 +58,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "ListOfAssociatedObjectStatus": { "type": "object", @@ -72,8 +71,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "AssociatedObjectStatus": { "type": "object", @@ -91,8 +89,7 @@ "required": [ "notification:AssociatedObject", "notification:Status" - ], - "additionalProperties": false + ] }, "NationalNotificationParameters": { "type": "object", @@ -103,8 +100,7 @@ }, "required": [ "notification:CountryCode" - ], - "additionalProperties": false + ] } } } diff --git a/103120/schema/json/ts_103120_Task.schema.json b/103120/schema/json/ts_103120_Task.schema.json index 5ced7ab9..fc2ad0c0 100644 --- a/103120/schema/json/ts_103120_Task.schema.json +++ b/103120/schema/json/ts_103120_Task.schema.json @@ -85,8 +85,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "TaskTimespan": { "type": "object", @@ -107,8 +106,7 @@ "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" } }, - "required": [], - "additionalProperties": false + "required": [] }, "TargetIdentifier": { "type": "object", @@ -123,8 +121,7 @@ "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" } }, - "required": [], - "additionalProperties": false + "required": [] }, "TargetIdentifierValues": { "type": "object", @@ -137,8 +134,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "TargetIdentifierValue": { "type": "object", @@ -153,8 +149,7 @@ "required": [ "task:FormatType", "task:Value" - ], - "additionalProperties": false + ] }, "FormatType": { "type": "object", @@ -169,8 +164,7 @@ "required": [ "task:FormatOwner", "task:FormatName" - ], - "additionalProperties": false + ] }, "TaskDeliveryDetails": { "type": "object", @@ -183,8 +177,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "DeliveryDestination": { "type": "object", @@ -208,8 +201,7 @@ "$ref": "#/$defs/NationalDeliveryParameters" } }, - "required": [], - "additionalProperties": false + "required": [] }, "DeliveryAddress": { "oneOf": [ @@ -346,8 +338,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "NationalLITaskingParameters": { "type": "object", @@ -358,8 +349,7 @@ }, "required": [ "task:CountryCode" - ], - "additionalProperties": false + ] }, "NationalDeliveryParameters": { "type": "object", @@ -370,8 +360,7 @@ }, "required": [ "task:CountryCode" - ], - "additionalProperties": false + ] }, "NationalEncryptionDetails": { "type": "object", @@ -382,8 +371,7 @@ }, "required": [ "task:CountryCode" - ], - "additionalProperties": false + ] }, "LDTaskObject": { "type": "object", @@ -462,8 +450,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "RequestDetails": { "type": "object", @@ -496,8 +483,7 @@ "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" } }, - "required": [], - "additionalProperties": false + "required": [] }, "RequestValues": { "type": "object", @@ -510,8 +496,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "RequestValue": { "type": "object", @@ -526,8 +511,7 @@ "required": [ "task:FormatType", "task:Value" - ], - "additionalProperties": false + ] }, "RequestSubtype": { "type": "object", @@ -540,8 +524,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "LDDeliveryDetails": { "type": "object", @@ -554,8 +537,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "LDDeliveryDestination": { "type": "object", @@ -576,8 +558,7 @@ "$ref": "#/$defs/NationalDeliveryParameters" } }, - "required": [], - "additionalProperties": false + "required": [] }, "LDTaskFlags": { "type": "object", @@ -589,8 +570,7 @@ } } }, - "required": [], - "additionalProperties": false + "required": [] }, "ListOfAlternativePreservationReferences": { "type": "object", @@ -603,8 +583,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "AlternativePreservationReference": { "type": "object", @@ -618,8 +597,7 @@ }, "required": [ "task:ReferenceValue" - ], - "additionalProperties": false + ] }, "NationalLDTaskingParameters": { "type": "object", @@ -630,8 +608,7 @@ }, "required": [ "task:CountryCode" - ], - "additionalProperties": false + ] }, "LPTaskObject": { "type": "object", @@ -695,8 +672,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "LPRequestDetails": { "type": "object", @@ -717,8 +693,7 @@ "$ref": "#/$defs/RequestSubtype" } }, - "required": [], - "additionalProperties": false + "required": [] }, "NationalLPTaskingParameters": { "type": "object", @@ -729,8 +704,7 @@ }, "required": [ "task:CountryCode" - ], - "additionalProperties": false + ] }, "ListOfTrafficPolicyReferences": { "type": "object", @@ -743,8 +717,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "TrafficPolicyReference": { "type": "object", @@ -757,8 +730,7 @@ "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" } }, - "required": [], - "additionalProperties": false + "required": [] } } } diff --git a/103120/schema/json/ts_103120_TrafficPolicy.schema.json b/103120/schema/json/ts_103120_TrafficPolicy.schema.json index b209a838..ef30ccae 100644 --- a/103120/schema/json/ts_103120_TrafficPolicy.schema.json +++ b/103120/schema/json/ts_103120_TrafficPolicy.schema.json @@ -46,8 +46,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "ListOfTrafficRuleReferences": { "type": "object", @@ -60,8 +59,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "TrafficRuleReference": { "type": "object", @@ -77,8 +75,7 @@ "required": [ "tp:Order", "tp:ObjectIdentifier" - ], - "additionalProperties": false + ] }, "TrafficRuleObject": { "type": "object", @@ -127,8 +124,7 @@ "required": [ "@xsi:type", "ObjectIdentifier" - ], - "additionalProperties": false + ] }, "ListOfTrafficCriteria": { "type": "object", @@ -141,8 +137,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "TrafficCriteria": { "oneOf": [ @@ -215,8 +210,7 @@ "type": "boolean" } }, - "required": [], - "additionalProperties": false + "required": [] }, "MobileAccessPolicyCriteria": { "type": "object", @@ -228,8 +222,7 @@ "$ref": "ts_103280_2017_07#/$defs/ShortString" } }, - "required": [], - "additionalProperties": false + "required": [] }, "EthernetPolicyCriteria": { "type": "object", @@ -247,8 +240,7 @@ "$ref": "#/$defs/VLANCriteria" } }, - "required": [], - "additionalProperties": false + "required": [] }, "VLANCriteria": { "oneOf": [ @@ -276,8 +268,7 @@ "minItems": 1 } }, - "required": [], - "additionalProperties": false + "required": [] }, "RCSPolicyCriteria": { "type": "object", @@ -288,8 +279,7 @@ }, "required": [ "tp:CommunicationServiceID" - ], - "additionalProperties": false + ] }, "ActionParameters": { "oneOf": [ @@ -319,8 +309,7 @@ }, "required": [ "tp:NumberOfOctets" - ], - "additionalProperties": false + ] } } } -- GitLab From e5ea01a3c287409484e3524b97cd92cfb36aee6d Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 6 Feb 2025 13:11:37 +0000 Subject: [PATCH 4/5] Rendered changes --- 103280/TS_103_280.schema.json | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/103280/TS_103_280.schema.json b/103280/TS_103_280.schema.json index b6824a99..405f1aad 100644 --- a/103280/TS_103_280.schema.json +++ b/103280/TS_103_280.schema.json @@ -56,7 +56,7 @@ }, "IPv4CIDR": { "type": "string", - "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\/([1-2]?[0-9]|3[0-2])$" + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/([1-2]?[0-9]|3[0-2])$" }, "IPv6Address": { "type": "string", @@ -279,7 +279,8 @@ "required": [ "etsi280:start", "etsi280:end" - ] + ], + "additionalProperties": false }, "UDPPortRange": { "type": "object", @@ -294,7 +295,8 @@ "required": [ "etsi280:start", "etsi280:end" - ] + ], + "additionalProperties": false }, "Port": { "oneOf": [ @@ -361,7 +363,8 @@ "required": [ "etsi280:address", "etsi280:port" - ] + ], + "additionalProperties": false }, "IPAddressPortRange": { "type": "object", @@ -376,7 +379,8 @@ "required": [ "etsi280:address", "etsi280:portRange" - ] + ], + "additionalProperties": false }, "WGS84CoordinateDecimal": { "type": "object", @@ -391,7 +395,8 @@ "required": [ "etsi280:latitude", "etsi280:longitude" - ] + ], + "additionalProperties": false }, "WGS84CoordinateAngular": { "type": "object", @@ -406,7 +411,8 @@ "required": [ "etsi280:latitude", "etsi280:longitude" - ] + ], + "additionalProperties": false } } } -- GitLab From 4eb7ec5f85269b38753cd47d8c410dbc3948a006 Mon Sep 17 00:00:00 2001 From: canterburym Date: Tue, 25 Feb 2025 07:05:52 +0000 Subject: [PATCH 5/5] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Steije van Schelt <239-svs@users.noreply.forge.etsi.org> --- utils/xml_to_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/xml_to_json.py b/utils/xml_to_json.py index e9609c79..3b8e6a10 100644 --- a/utils/xml_to_json.py +++ b/utils/xml_to_json.py @@ -147,7 +147,7 @@ if __name__ == "__main__": logging.debug(f"Arguments: {args}") s = args.input.read() - args.input.close() + args.input.close() logging.debug(s) -- GitLab