diff --git a/103120/examples/json/request4-TargetIdentifierSubtype.json b/103120/examples/json/request4-TargetIdentifierSubtype.json new file mode 100644 index 0000000000000000000000000000000000000000..4f2a309ce454c9fc497d0591f64781e640d47f7a --- /dev/null +++ b/103120/examples/json/request4-TargetIdentifierSubtype.json @@ -0,0 +1,103 @@ +{ + "@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": { + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "c02358b2-76cf-4ba4-a8eb-f6436ccaea2e", + "Timestamp": "2019-09-30T13:37: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": "2019-09-30T12:00:00Z", + "auth:EndTime": "2019-12-01T12:00:00Z" + } + } + } + }, + { + "ActionIdentifier": 1, + "CREATE": { + "HI1Object": { + "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Task}LDTaskObject", + "ObjectIdentifier": "2b36a78b-b628-416d-bd22-404e68a0cd36", + "CountryCode": "XX", + "OwnerIdentifier": "ACTOR01", + "AssociatedObjects": { + "AssociatedObject": [ + "7dbbc880-8750-4d3c-abe7-ea4a17646045" + ] + }, + "task:Reference": "XX-ACTOR01-1234", + "task:RequestDetails": { + "task:Type": { + "common:Owner": "ETSI", + "common:Name": "RequestType", + "common:Value": "SubscriberData" + }, + "task:StartTime": "2019-09-30T12:00:00Z", + "task:EndTime": "2019-12-30T12:00:00Z", + "task:RequestValues": { + "task:RequestValue": [ + { + "task:FormatType": { + "task:FormatOwner": "ETSI", + "task:FormatName": "ServiceAccessIdentifier" + }, + "task:Value": "123456789" + } + ] + }, + "task:TargetIdentifierSubtype": { + "common:Owner": "ACTOR02", + "common:Name": "TargetIdentifierSubtype", + "common:Value": "AccountTypeB" + } + }, + "task:DeliveryDetails": { + "task:LDDeliveryDestination": [ + { + "task:DeliveryAddress": { + "task:IPv4Address": "192.0.2.0" + } + } + ] + }, + "task:CSPID": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + } + } + } + } + ] + } + } + } +} diff --git a/103120/examples/json/request_config.json b/103120/examples/json/request_config.json new file mode 100644 index 0000000000000000000000000000000000000000..e8e73308951445e44fa219b8d0deae938ada5709 --- /dev/null +++ b/103120/examples/json/request_config.json @@ -0,0 +1,36 @@ +{ + "@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": { + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "eb6b002d-15c3-4c3b-af6c-27ede73641e5", + "Timestamp": "2024-06-10T08:50:31.000000Z", + "Version": { + "ETSIVersion": "V1.16.1", + "NationalProfileOwner": "XX", + "NationalProfileVersion": "v1.0" + } + }, + "Payload": { + "RequestPayload": { + "ActionRequests": { + "ActionRequest": [ + { + "ActionIdentifier": 0, + "GETCSPCONFIG": {} + } + ] + } + } + } +} diff --git a/103120/examples/json/response_config.json b/103120/examples/json/response_config.json new file mode 100644 index 0000000000000000000000000000000000000000..d0f4a1f82b231b8fb273bb2a6d747d533a482bc6 --- /dev/null +++ b/103120/examples/json/response_config.json @@ -0,0 +1,126 @@ +{ + "@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:config": "http://uri.etsi.org/03120/common/2024/06/Config", + "@xmlns:dictionaries": "http://uri.etsi.org/03280/common/2019/10/Dictionaries", + "Header": { + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "eb6b002d-15c3-4c3b-af6c-27ede73641e5", + "Timestamp": "2024-06-10T08:50:31.000000Z", + "Version": { + "ETSIVersion": "V1.16.1", + "NationalProfileOwner": "XX", + "NationalProfileVersion": "v1.0" + } + }, + "Payload": { + "ResponsePayload": { + "ActionResponses": { + "ActionResponse": [ + { + "ActionIdentifier": 0, + "GETCSPCONFIGResponse": { + "LastChanged": "2024-05-10T08:52:32Z", + "Dictionaries": { + "dictionaries:Dictionary": [ + { + "dictionaries:Owner": "ACTOR2", + "dictionaries:Name": "LIServiceTypes", + "dictionaries:DictionaryEntries": { + "dictionaries:DictionaryEntry": [ + { + "dictionaries:Value": "ServiceA", + "dictionaries:Meaning": "This is a dictionary entry" + }, + { + "dictionaries:Value": "ServiceB", + "dictionaries:Meaning": "This is a dictionary entry" + } + ] + } + } + ] + }, + "TargetFormatTypeDefinitions": { + "config:FormatOwner": "ACTOR02", + "config:TargetFormatTypeDefinitionEntries": { + "config:TargetFormatTypeDefinitionEntry": [ + { + "config:FormatName": "ProprietaryIdentifier", + "config:Description": "This is an illustration of a proprietary identifier type specific to this CSP, which consists of the string \"CSP\" followed by 10 digits", + "config:FormatRegex": "^CSP[0-9]{10}$" + } + ] + } + }, + "TargetingConfigurations": { + "config:TargetingConfiguration": [ + { + "config:FormatName": "InternationalE164", + "config:FormatOwner": "ETSI", + "config:Guidance": "This configuration entry tells the LEA that they can use the ETSI standard format E164 number for LI of service A", + "config:AssociatedLIServiceTypes": { + "common:DictionaryEntry": [ + { + "common:Owner": "ACTOR02", + "common:Name": "LIServiceTypes", + "common:Value": "ServiceA" + } + ] + }, + "config:AssociatedLDRequestSubtypes": {}, + "config:AssociatedLPRequestSubtypes": {} + }, + { + "config:FormatName": "PropietaryIdentifier", + "config:FormatOwner": "ACTOR02", + "config:Guidance": "This configuration entry tells the LEA that they can use the propietary identifier format type described in the TargetFormatTypeDefinitions for LI of both Service A and Service B", + "config:AssociatedLIServiceTypes": { + "common:DictionaryEntry": [ + { + "common:Owner": "ACTOR02", + "common:Name": "LIServiceTypes", + "common:Value": "ServiceA" + }, + { + "common:Owner": "ACTOR02", + "common:Name": "LIServiceTypes", + "common:Value": "ServiceB" + } + ] + }, + "config:AssociatedLDRequestSubtypes": {}, + "config:AssociatedLPRequestSubtypes": {} + } + ] + }, + "SupportedLIWorkflowEndpoints": { + "config:SupportedLIWorkflowEndpoint": [ + { + "config:LIWorkflowEndpoint": { + "common:Owner": "ETSI", + "common:Name": "LIWorkflowEndpoint", + "common:Value": "NewAuthorisation" + }, + "config:Guidance": "This tells the LEA what endpoint to use for new warrants. For brevity, in this example, this is the only endpoint specified.", + "config:URL": "https://ts103120.example.com/li/authorisation/new" + } + ] + }, + "SupportedLPWorkflowEndpoints": {} + } + } + ] + } + } + } +} diff --git a/103120/schema/json/ts_103120_Common.schema.json b/103120/schema/json/ts_103120_Common.schema.json index c13f91bfdc258a296553f2a6e6bacf8cccda5316..d5c94ea2cade3664a84b224a9eb4b02819be788e 100644 --- a/103120/schema/json/ts_103120_Common.schema.json +++ b/103120/schema/json/ts_103120_Common.schema.json @@ -13,6 +13,18 @@ } ] }, + "DictionaryEntries": { + "type": "object", + "properties": { + "common:DictionaryEntry": { + "type": "array", + "items": { + "$ref": "#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, "DictionaryEntry": { "type": "object", "properties": { diff --git a/103120/schema/json/ts_103120_Core.schema.json b/103120/schema/json/ts_103120_Core.schema.json index 71e583dc8eba11453ec15518dde835d02cbae382..11ca5f523d8b79634900effb6752ed7e5251aa06 100644 --- a/103120/schema/json/ts_103120_Core.schema.json +++ b/103120/schema/json/ts_103120_Core.schema.json @@ -254,6 +254,17 @@ "required": [ "DELIVER" ] + }, + { + "type": "object", + "properties": { + "GETCSPCONFIG": { + "$ref": "#/$defs/GETCSPCONFIGRequest" + } + }, + "required": [ + "GETCSPCONFIG" + ] } ] } @@ -340,6 +351,17 @@ "required": [ "DELIVERResponse" ] + }, + { + "type": "object", + "properties": { + "GETCSPCONFIGResponse": { + "$ref": "#/$defs/GETCSPCONFIGResponse" + } + }, + "required": [ + "GETCSPCONFIGResponse" + ] } ] } @@ -515,6 +537,28 @@ "Identifier" ] }, + "GETCSPCONFIGRequest": { + "type": "object", + "properties": {}, + "required": [] + }, + "GETCSPCONFIGResponse": { + "type": "object", + "properties": { + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "Dictionaries": {}, + "TargetFormatTypeDefinitions": {}, + "TargetingConfigurations": {}, + "SupportedLIWorkflowEndpoints": {}, + "SupportedLPWorkflowEndpoints": {} + }, + "required": [ + "LastChanged", + "TargetingConfigurations" + ] + }, "HI1Object": { "type": "object", "properties": { diff --git a/103120/schema/json/ts_103120_Task.schema.json b/103120/schema/json/ts_103120_Task.schema.json index 7df2c44c9f05c65213bf1263c2ec686a8fb93854..fc2ad0c0a85c41ff5bea5ef313c1a2120efe1d10 100644 --- a/103120/schema/json/ts_103120_Task.schema.json +++ b/103120/schema/json/ts_103120_Task.schema.json @@ -116,6 +116,9 @@ }, "task:ServiceType": { "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:TargetIdentifierSubtype": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" } }, "required": [] @@ -475,6 +478,9 @@ }, "task:Subtype": { "$ref": "#/$defs/RequestSubtype" + }, + "task:TargetIdentifierSubtype": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" } }, "required": [] diff --git a/103280/TS_103_280.schema.json b/103280/TS_103_280.schema.json index caf41eca9989ec46d999f85ea758188768c02b56..aa63f8183191f19ae988167b37237d9a34ca1a3f 100644 --- a/103280/TS_103_280.schema.json +++ b/103280/TS_103_280.schema.json @@ -409,4 +409,4 @@ ] } } -} \ No newline at end of file +} diff --git a/utils/xml_to_json.py b/utils/xml_to_json.py index a89777f553533ee2c7b008bdc170ee0a605159b9..86f8ad7ec394603683a3ce6fccd7a4e16aad330d 100644 --- a/utils/xml_to_json.py +++ b/utils/xml_to_json.py @@ -66,7 +66,12 @@ coerce_to_list = [ 'task:LDTaskFlag', 'task:TrafficPolicyReference', 'tp:TrafficRuleReference', - 'tp:Criteria' + 'tp:Criteria', + 'common:DictionaryEntry', + 'dictionaries:Dictionary', + 'config:TargetFormatTypeDefinitionEntry', + 'config:SupportedLIWorkflowEndpoint', + 'config:SupportedLPWorkflowEndpoint', ] coerce_to_int = [ @@ -81,6 +86,18 @@ coerce_to_bool = [ 'delivery:LastSequence' ] +coerce_to_empty = [ + 'GETCSPCONFIG' +] + +coerce_null_to_empty = [ + 'SupportedLIWorkflowEndpoints', + 'SupportedLPWorkflowEndpoints', + 'config:AssociatedLDRequestSubtypes', + 'config:AssociatedLPRequestSubtypes', + 'config:AssociatedLIRequestSubtypes', +] + def postprocessor (path, key, value): if key == "@xsi:type": object_name = value.split(":")[-1] @@ -91,6 +108,11 @@ def postprocessor (path, key, value): return key, int(value) if key in coerce_to_bool: return key, bool(value) + if key in coerce_to_empty: + return key, {} + if key in coerce_null_to_empty: + if value is None: + return key, {} return key, value if __name__ == "__main__":