diff --git a/103120/examples/json/request1_bad.json b/103120/examples/json/request1_bad.json new file mode 100644 index 0000000000000000000000000000000000000000..70fc486f394a76719ace8fcb6020d3c228a12984 --- /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 09afd84ece898fd6384683a3cbc949c38544677b..be0fc8846b108d0f17b6b344825f4d5b4f73aedc 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:policy": "http://uri.etsi.org/03120/common/2022/07/TrafficPolicy", - "@xmlns:etsi": "http://uri.etsi.org/03280/common/2017/07", + "@xmlns:tp": "http://uri.etsi.org/03120/common/2022/07/TrafficPolicy", + "@xmlns:etsi280": "http://uri.etsi.org/03280/common/2017/07", "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", "Header": { "SenderIdentifier": { @@ -34,16 +34,25 @@ "ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5", "CountryCode": "XX", "OwnerIdentifier": "ACTOR01", - "policy:Criteria": { - "policy:Criteria": { - "policy:IPPolicyCriteria": { - "policy:SourceIPRange": { - "etsi:IPv4CIDR": "203.0.113.0/24" + "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:Action": { + "tp:Action": { "common:Owner": "ETSI", "common:Name": "PolicyAction", "common:Value": "PDSR" @@ -59,12 +68,14 @@ "ObjectIdentifier": "55e25c0a-787b-4049-b7fb-518a13a9483b", "CountryCode": "XX", "OwnerIdentifier": "ACTOR01", - "policy:TrafficPolicyName": "Template Rule 1", - "policy:TrafficRules": { - "policy:TrafficRuleReference": { - "policy:Order": "1", - "policy:ObjectIdentifier": "f69eb93b-a85b-4ff7-abaa-6f3aead286d5" - } + "tp:TrafficPolicyName": "Template Rule 1", + "tp:TrafficRules": { + "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 7ee2e5ef56d357f15240db2654f85dc9b77ad3b4..bbcd6881c35e03b1aa648b2b9c2bc273aca4431c 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/103120/schema/json/ts_103120_Authorisation.schema.json b/103120/schema/json/ts_103120_Authorisation.schema.json index 942438fab1fce00708ebd1d7d6795daf49ae4a0f..0fc3e10fad4b1d74e74df83d7ca171c0aee35344 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 d5c94ea2cade3664a84b224a9eb4b02819be788e..21009361f1672719aeccf438b8e256348a8b9c87 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 8ac79cfed9753e5dc69c64f154e09d7402ada125..0b1d90f422b5917ccef03893fbb27386516d1a3d 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 6b417629733db034ca82e7b2a1da704f70596ec7..6ca0ffa208b42550cccfe4453ef5e3aea5bb3e6d 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 3bc734cac2f658ea69bd37387766b213994aa00f..5adf5aa0d96f5084391b5755a0d863f4fcca5cf6 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 aadb98907307716417a45f3d2093a763ba495032..3654fa3e7707bebb212355cadfb79000c3c5c277 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 fc2ad0c0a85c41ff5bea5ef313c1a2120efe1d10..5ced7ab9c49a323ec708f934c1f8d151229aece8 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 ef30ccae552f5d30a010ae4b955acb1f4b7e1fed..b209a83877b39e5002ac4642e7ec46d908df6dd9 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/103280/TS_103_280.schema.json b/103280/TS_103_280.schema.json index aa63f8183191f19ae988167b37237d9a34ca1a3f..b6824a99cf7da2cc6a4c84cff000ef06d6021c6e 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/translate/ChoiceMapping.py b/utils/translate/ChoiceMapping.py index b477a3360e0a6a7b891f5854951eb4f37dce4b39..052bd45e3ceb987f0ebe18556f6afad2df9c6789 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 341ac51469a8b0f9ad5fd0c66ae9c45aac93f277..9932c4667e9178a387f7b0ccddc3fe29cd942d6e 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 e950b4ae12cbd09066593774f8b560a2805cce4d..f2008595106b4edd7c606e6af9a5250c4bc7f15b 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 diff --git a/utils/xml_to_json.py b/utils/xml_to_json.py index 86f8ad7ec394603683a3ce6fccd7a4e16aad330d..e9609c79d11bdced4164f6f515f31759fdb1d64e 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)