diff --git a/103120/json_examples/example1_test.json b/103120/json_examples/example1_test.json new file mode 100644 index 0000000000000000000000000000000000000000..f0e1df4d508ca3b2e21df06d6f1d4a16d74a812f --- /dev/null +++ b/103120/json_examples/example1_test.json @@ -0,0 +1,47 @@ +{ + "Header" : { + "SenderIdentifier" : { + "CountryCode" : "XX", + "UniqueIdentifier" : "ACTOR01" + }, + "ReceiverIdentifier" : { + "CountryCode" : "YY", + "UniqueIdentifier" : "ACTOR02" + }, + "TransactionIdentifier" : "c4a09046-61da-485b-83f2-ca12caebf40b", + "Timestamp" : "2022-06-10T15:50:00.000000Z", + "Version" : { + "ETSIVersion" : "V1.11.2", + "NationalProfileOwner" : "NA", + "NationalProfileVersion" : "NA" + } + }, + "Payload" : { + "ResponsePayload" : { + "ActionResponses" : { + "ActionResponse" : [{ + "ActionIdentifier" : 0, + "CREATEResponse" : { + "Identifier" : "f25dec16-927c-433b-959c-1886182cac58", + "HI1Object" : { + "xsiType" : "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject", + "ObjectIdentifier" : "d980e335-d17a-471f-bb40-cddf4457fd6b", + "Reference" : "LIID", + "TargetIdentifier" : { + "TargetIdentifierValues" : { + "TargetIdentifierValue" : [ { + "FormatType" : { + "FormatOwner" : "ETSI", + "FormatName" : "InternationalE164" + }, + "Value" : "447700900123" + } ] + } + } + } + } + }] + } + } + } +} \ No newline at end of file diff --git a/103120/json_schema/TS_103_120_authorisation.json b/103120/json_schema/TS_103_120_authorisation.json new file mode 100644 index 0000000000000000000000000000000000000000..3591164b72a2eb8dc2ec96d4275b123b7affbb12 --- /dev/null +++ b/103120/json_schema/TS_103_120_authorisation.json @@ -0,0 +1,139 @@ +{ + "$id": "TS_103_120_authorisation.json", + "$defs": { + "AuthorisationObject": { + "type": "object", + "properties": { + "xsiType": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject" + }, + "ObjectIdentifier": { + "$ref": "TS_103_120_core.json#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "TS_103_120_core.json#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "TS_103_120_core.json#/$defs/NationalHandlingParameters" + }, + "AuthorisationReference": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AuthorisationLegalType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "AuthorisationPriority": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "AuthorisationStatus": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "AuthorisationDesiredStatus": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "AuthorisationTimespan": { + "$ref": "#/$defs/AuthorisationTimespan" + }, + "AuthorisationCSPID": { + "$ref": "#/$defs/AuthorisationCSPID" + }, + "AuthorisationCreationTimestamp": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "AuthorisationServedTimestamp": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "AuthorisationTerminationTimestamp": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "AuthorisationApprovalDetails": { + "type": "array", + "items": { + "$ref": "TS_103_120_common.json#/$defs/ApprovalDetails" + } + }, + "AuthorisationInvalidReason": { + "$ref": "TS_103_120_core.json#/$defs/ActionUnsuccesfulInformation" + }, + "AuthorisationFlags": { + "$ref": "#/$defs/AuthorisationFlags" + }, + "AuthorisationManualInformation": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "NationalAuthorisationParameters": { + "$ref": "#/$defs/NationalAuthorisationParameters" + } + }, + "required": [ + "xsiType", + "ObjectIdentifier" + ] + }, + "AuthorisationFlags": { + "type": "object", + "properties": { + "AuthorisationFlag": { + "type": "array", + "items": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, + "AuthorisationTimespan": { + "type": "object", + "properties": { + "StartTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "EndTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "AuthorisationCSPID": { + "type": "object", + "properties": { + "CSPID": { + "type": "array", + "items": { + "$ref": "TS_103_120_core.json#/$defs/EndpointID" + }, + "minItems": 1 + } + }, + "required": [] + }, + "NationalAuthorisationParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/json_schema/TS_103_120_common.json b/103120/json_schema/TS_103_120_common.json new file mode 100644 index 0000000000000000000000000000000000000000..34ffdc4ed642f31430708750b9ce95b8a603240e --- /dev/null +++ b/103120/json_schema/TS_103_120_common.json @@ -0,0 +1,164 @@ +{ + "$id": "TS_103_120_common.json", + "$defs": { + "ETSIVersion": { + "allOf": [ + { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^V\\d+\\.\\d+\\.\\d+$" + } + ] + }, + "DictionaryEntry": { + "type": "object", + "properties": { + "Owner": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Name": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Value": { + "$ref": "etsi103280.json#/$defs/ShortString" + } + }, + "required": [ + "Owner", + "Name", + "Value" + ] + }, + "ApprovalDetails": { + "type": "object", + "properties": { + "ApprovalType": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "ApprovalDescription": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "ApprovalReference": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "ApproverDetails": { + "$ref": "#/$defs/ApproverDetails" + }, + "ApprovalTimestamp": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "ApprovalIsEmergency": { + "type": "boolean" + }, + "ApprovalDigitalSignature": { + "$ref": "#/$defs/ApprovalDigitalSignature" + }, + "ApprovalNationalDetails": { + "$ref": "#/$defs/ApprovalNationalDetails" + } + }, + "required": [] + }, + "ApproverDetails": { + "type": "object", + "properties": { + "ApproverName": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "ApproverRole": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "ApproverIdentity": { + "$ref": "#/$defs/ApproverIdentity" + }, + "ApproverContactDetails": { + "type": "array", + "items": { + "$ref": "#/$defs/ApproverContactDetails" + } + } + }, + "required": [] + }, + "ApproverIdentity": { + "oneOf": [ + { + "type": "object", + "properties": { + "NationalApproverIdentity": { + "$ref": "#/$defs/NationalApproverIdentity" + } + }, + "required": [ + "NationalApproverIdentity" + ] + } + ] + }, + "ApproverContactDetails": { + "type": "object", + "properties": { + "ApproverAlternateName": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "ApproverEmailAddress": { + "$ref": "etsi103280.json#/$defs/InternationalizedEmailAddress" + }, + "ApproverPhoneNumber": { + "$ref": "etsi103280.json#/$defs/InternationalE164" + } + }, + "required": [] + }, + "NationalApproverIdentity": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + }, + "ApprovalDigitalSignature": { + "oneOf": [ + { + "type": "object", + "properties": { + "NationalDigitalSignature": { + "$ref": "#/$defs/NationalDigitalSignature" + } + }, + "required": [ + "NationalDigitalSignature" + ] + } + ] + }, + "ApprovalNationalDetails": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + }, + "NationalDigitalSignature": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/json_schema/TS_103_120_core.json b/103120/json_schema/TS_103_120_core.json new file mode 100644 index 0000000000000000000000000000000000000000..44adf1d5b60a8025d9548719b683e285db210b4c --- /dev/null +++ b/103120/json_schema/TS_103_120_core.json @@ -0,0 +1,583 @@ +{ + "$id": "TS_103_120_core.json", + "$defs": { + "ObjectIdentifier": { + "$ref": "etsi103280.json#/$defs/UUID" + }, + "HI1Message": { + "type": "object", + "properties": { + "Header": { + "$ref": "#/$defs/MessageHeader" + }, + "Payload": { + "$ref": "#/$defs/MessagePayload" + }, + "Signature": { + "$ref": "xmldsig.json#/$defs/SignatureType" + } + }, + "required": [ + "Header", + "Payload" + ] + }, + "MessageHeader": { + "type": "object", + "properties": { + "SenderIdentifier": { + "$ref": "#/$defs/EndpointID" + }, + "ReceiverIdentifier": { + "$ref": "#/$defs/EndpointID" + }, + "TransactionIdentifier": { + "$ref": "etsi103280.json#/$defs/UUID" + }, + "Timestamp": { + "$ref": "etsi103280.json#/$defs/QualifiedMicrosecondDateTime" + }, + "Version": { + "$ref": "#/$defs/Version" + } + }, + "required": [ + "SenderIdentifier", + "ReceiverIdentifier", + "TransactionIdentifier", + "Timestamp", + "Version" + ] + }, + "Version": { + "type": "object", + "properties": { + "ETSIVersion": { + "$ref": "TS_103_120_common.json#/$defs/ETSIVersion" + }, + "NationalProfileOwner": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "NationalProfileVersion": { + "$ref": "etsi103280.json#/$defs/ShortString" + } + }, + "required": [ + "ETSIVersion", + "NationalProfileOwner", + "NationalProfileVersion" + ] + }, + "EndpointID": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "UniqueIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + } + }, + "required": [ + "CountryCode", + "UniqueIdentifier" + ] + }, + "MessagePayload": { + "oneOf": [ + { + "type": "object", + "properties": { + "RequestPayload": { + "$ref": "#/$defs/RequestPayload" + } + }, + "required": [ + "RequestPayload" + ] + }, + { + "type": "object", + "properties": { + "ResponsePayload": { + "$ref": "#/$defs/ResponsePayload" + } + }, + "required": [ + "ResponsePayload" + ] + } + ] + }, + "RequestPayload": { + "type": "object", + "properties": { + "ActionRequests": { + "$ref": "#/$defs/ActionRequests" + } + }, + "required": [ + "ActionRequests" + ] + }, + "ActionRequests": { + "type": "object", + "properties": { + "ActionRequest": { + "type": "array", + "items": { + "$ref": "#/$defs/ActionRequest" + }, + "minItems": 1 + } + }, + "required": [] + }, + "ResponsePayload": { + "oneOf": [ + { + "type": "object", + "properties": { + "ActionResponses": { + "$ref": "#/$defs/ActionResponses" + } + }, + "required": [ + "ActionResponses" + ] + }, + { + "type": "object", + "properties": { + "ErrorInformation": { + "$ref": "#/$defs/ActionUnsuccesfulInformation" + } + }, + "required": [ + "ErrorInformation" + ] + } + ] + }, + "ActionResponses": { + "type": "object", + "properties": { + "ActionResponse": { + "type": "array", + "items": { + "$ref": "#/$defs/ActionResponse" + }, + "minItems": 1 + } + }, + "required": [] + }, + "ActionRequest": { + "allOf": [ + { + "type": "object", + "properties": { + "ActionIdentifier": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "ActionIdentifier" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "GET": { + "$ref": "#/$defs/GETRequest" + } + }, + "required": [ + "GET" + ] + }, + { + "type": "object", + "properties": { + "CREATE": { + "$ref": "#/$defs/CREATERequest" + } + }, + "required": [ + "CREATE" + ] + }, + { + "type": "object", + "properties": { + "UPDATE": { + "$ref": "#/$defs/UPDATERequest" + } + }, + "required": [ + "UPDATE" + ] + }, + { + "type": "object", + "properties": { + "LIST": { + "$ref": "#/$defs/LISTRequest" + } + }, + "required": [ + "LIST" + ] + }, + { + "type": "object", + "properties": { + "DELIVER": { + "$ref": "#/$defs/DELIVERRequest" + } + }, + "required": [ + "DELIVER" + ] + } + ] + } + ] + }, + "ActionResponse": { + "allOf": [ + { + "type": "object", + "properties": { + "ActionIdentifier": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "ActionIdentifier" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "GETResponse": { + "$ref": "#/$defs/GETResponse" + } + }, + "required": [ + "GETResponse" + ] + }, + { + "type": "object", + "properties": { + "CREATEResponse": { + "$ref": "#/$defs/CREATEResponse" + } + }, + "required": [ + "CREATEResponse" + ] + }, + { + "type": "object", + "properties": { + "UPDATEResponse": { + "$ref": "#/$defs/UPDATEResponse" + } + }, + "required": [ + "UPDATEResponse" + ] + }, + { + "type": "object", + "properties": { + "LISTResponse": { + "$ref": "#/$defs/LISTResponse" + } + }, + "required": [ + "LISTResponse" + ] + }, + { + "type": "object", + "properties": { + "ErrorInformation": { + "$ref": "#/$defs/ActionUnsuccesfulInformation" + } + }, + "required": [ + "ErrorInformation" + ] + }, + { + "type": "object", + "properties": { + "DELIVERResponse": { + "$ref": "#/$defs/DELIVERResponse" + } + }, + "required": [ + "DELIVERResponse" + ] + } + ] + } + ] + }, + "GETRequest": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + } + }, + "required": [ + "Identifier" + ] + }, + "GETResponse": { + "type": "object", + "properties": { + "HI1Object": { + "$ref": "#/$defs/OneOfHI1Object" + } + }, + "required": [ + "HI1Object" + ] + }, + "CREATERequest": { + "type": "object", + "properties": { + "HI1Object": { + "$ref": "#/$defs/OneOfHI1Object" + } + }, + "required": [ + "HI1Object" + ] + }, + "CREATEResponse": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "HI1Object": { + "$ref": "#/$defs/OneOfHI1Object" + } + }, + "required": [ + "Identifier" + ] + }, + "UPDATERequest": { + "type": "object", + "properties": { + "HI1Object": { + "$ref": "#/$defs/OneOfHI1Object" + } + }, + "required": [ + "HI1Object" + ] + }, + "UPDATEResponse": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "HI1Object": { + "$ref": "#/$defs/OneOfHI1Object" + } + }, + "required": [ + "Identifier" + ] + }, + "LISTRequest": { + "type": "object", + "properties": { + "ObjectType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "LISTResponse": { + "type": "object", + "properties": { + "ListResponseRecord": { + "type": "array", + "items": { + "$ref": "#/$defs/ListResponseRecord" + } + } + }, + "required": [] + }, + "ListResponseRecord": { + "type": "object", + "properties": { + "ObjectType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + } + }, + "required": [ + "ObjectType", + "Identifier", + "Generation" + ] + }, + "ActionUnsuccesfulInformation": { + "type": "object", + "properties": { + "ErrorCode": { + "type": "integer", + "minimum": 0 + }, + "ErrorDescription": { + "$ref": "etsi103280.json#/$defs/LongString" + } + }, + "required": [ + "ErrorCode", + "ErrorDescription" + ] + }, + "DELIVERRequest": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "HI1Object": { + "$ref": "#/$defs/OneOfHI1Object" + } + }, + "required": [ + "Identifier", + "HI1Object" + ] + }, + "DELIVERResponse": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + } + }, + "required": [ + "Identifier" + ] + }, + "HI1Object": { + "type": "object", + "properties": { + "ObjectIdentifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "#/$defs/NationalHandlingParameters" + } + }, + "required": [ + "ObjectIdentifier" + ] + }, + "AssociatedObjects": { + "type": "object", + "properties": { + "AssociatedObject": { + "type": "array", + "items": { + "$ref": "#/$defs/ObjectIdentifier" + } + } + }, + "required": [] + }, + "NationalHandlingParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + }, + "OneOfHI1Object": { + "oneOf": [ + { + "$ref": "TS_103_120_authorisation.json#/$defs/AuthorisationObject" + }, + { + "$ref": "TS_103_120_task.json#/$defs/LITaskObject" + }, + { + "$ref": "TS_103_120_task.json#/$defs/LDTaskObject" + }, + { + "$ref": "TS_103_120_document.json#/$defs/DocumentObject" + }, + { + "$ref": "TS_103_120_notification.json#/$defs/NotificationObject" + } + ] + } + }, + "$ref": "#/$defs/HI1Message" +} \ No newline at end of file diff --git a/103120/json_schema/TS_103_120_delivery.json b/103120/json_schema/TS_103_120_delivery.json new file mode 100644 index 0000000000000000000000000000000000000000..6e6b4c1a8ab5474846c54b253c209718b909e0bc --- /dev/null +++ b/103120/json_schema/TS_103_120_delivery.json @@ -0,0 +1,209 @@ +{ + "$id": "TS_103_120_delivery.json", + "$defs": { + "DeliveryObject": { + "type": "object", + "properties": { + "xsiType": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2019/10/Delivery}DeliveryObject" + }, + "ObjectIdentifier": { + "$ref": "TS_103_120_core.json#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "TS_103_120_core.json#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "TS_103_120_core.json#/$defs/NationalHandlingParameters" + }, + "Reference": { + "$ref": "#/$defs/Reference" + }, + "DeliveryID": { + "$ref": "etsi103280.json#/$defs/UUID" + }, + "SequenceNumber": { + "type": "integer", + "minimum": 0 + }, + "LastSequence": { + "type": "boolean" + }, + "Manifest": { + "$ref": "#/$defs/Manifest" + }, + "Delivery": { + "$ref": "#/$defs/Delivery" + } + }, + "required": [ + "xsiType", + "ObjectIdentifier" + ] + }, + "Reference": { + "oneOf": [ + { + "type": "object", + "properties": { + "LDID": { + "$ref": "etsi103280.json#/$defs/LDID" + } + }, + "required": [ + "LDID" + ] + }, + { + "type": "object", + "properties": { + "LIID": { + "$ref": "etsi103280.json#/$defs/LIID" + } + }, + "required": [ + "LIID" + ] + } + ] + }, + "Manifest": { + "oneOf": [ + { + "type": "object", + "properties": { + "Specification": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + } + }, + "required": [ + "Specification" + ] + }, + { + "type": "object", + "properties": { + "ExternalSchema": { + "$ref": "#/$defs/ExternalSchema" + } + }, + "required": [ + "ExternalSchema" + ] + } + ] + }, + "ExternalSchema": { + "type": "object", + "properties": { + "ManifestID": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "ManifestContents": { + "$ref": "#/$defs/ManifestContents" + } + }, + "required": [] + }, + "ManifestContents": { + "oneOf": [ + { + "type": "object", + "properties": { + "BinaryData": { + "$ref": "#/$defs/EmbeddedBinaryData" + } + }, + "required": [ + "BinaryData" + ] + }, + { + "type": "object", + "properties": { + "XMLSchema": { + "$ref": "#/$defs/SchemaContent" + } + }, + "required": [ + "XMLSchema" + ] + } + ] + }, + "SchemaContent": { + "type": "object", + "properties": { + "schema": {} + }, + "required": [ + "schema" + ] + }, + "Delivery": { + "oneOf": [ + { + "type": "object", + "properties": { + "BinaryData": { + "$ref": "#/$defs/EmbeddedBinaryData" + } + }, + "required": [ + "BinaryData" + ] + }, + { + "type": "object", + "properties": { + "XMLData": { + "$ref": "#/$defs/EmbeddedXMLData" + } + }, + "required": [ + "XMLData" + ] + } + ] + }, + "EmbeddedBinaryData": { + "type": "object", + "properties": { + "Data": { + "type": "string", + "pattern": "^[-A-Za-z0-9+/]*={0,3}$" + }, + "ContentType": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Checksum": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "ChecksumType": { + "$ref": "etsi103280.json#/$defs/ShortString" + } + }, + "required": [ + "Data" + ] + }, + "EmbeddedXMLData": {} + } +} \ No newline at end of file diff --git a/103120/json_schema/TS_103_120_document.json b/103120/json_schema/TS_103_120_document.json new file mode 100644 index 0000000000000000000000000000000000000000..ca04c04c2261d5e652298ccb3f976586817cb86a --- /dev/null +++ b/103120/json_schema/TS_103_120_document.json @@ -0,0 +1,148 @@ +{ + "$id": "TS_103_120_document.json", + "$defs": { + "DocumentObject": { + "type": "object", + "properties": { + "xsiType": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Document}DocumentObject" + }, + "ObjectIdentifier": { + "$ref": "TS_103_120_core.json#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "TS_103_120_core.json#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "TS_103_120_core.json#/$defs/NationalHandlingParameters" + }, + "DocumentReference": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "DocumentName": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "DocumentStatus": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "DocumentDesiredStatus": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "DocumentTimespan": { + "$ref": "#/$defs/DocumentTimespan" + }, + "DocumentType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "DocumentProperties": { + "$ref": "#/$defs/DocumentProperties" + }, + "DocumentBody": { + "$ref": "#/$defs/DocumentBody" + }, + "DocumentSignature": { + "type": "array", + "items": { + "$ref": "TS_103_120_common.json#/$defs/ApprovalDetails" + } + }, + "DocumentInvalidReason": { + "$ref": "TS_103_120_core.json#/$defs/ActionUnsuccesfulInformation" + }, + "NationalDocumentParameters": { + "$ref": "#/$defs/NationalDocumentParameters" + } + }, + "required": [ + "xsiType", + "ObjectIdentifier" + ] + }, + "DocumentTimespan": { + "type": "object", + "properties": { + "StartTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "EndTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "DocumentProperties": { + "type": "object", + "properties": { + "DocumentProperty": { + "type": "array", + "items": { + "$ref": "#/$defs/DocumentProperty" + } + } + }, + "required": [] + }, + "DocumentProperty": { + "type": "object", + "properties": { + "PropertyType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "PropertyValue": { + "$ref": "etsi103280.json#/$defs/LongString" + } + }, + "required": [ + "PropertyType", + "PropertyValue" + ] + }, + "DocumentBody": { + "type": "object", + "properties": { + "Contents": { + "type": "string", + "pattern": "^[-A-Za-z0-9+/]*={0,3}$" + }, + "ContentType": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Checksum": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "ChecksumType": { + "$ref": "etsi103280.json#/$defs/ShortString" + } + }, + "required": [] + }, + "NationalDocumentParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/json_schema/TS_103_120_notification.json b/103120/json_schema/TS_103_120_notification.json new file mode 100644 index 0000000000000000000000000000000000000000..76f549e4e35d6ef070cedb3e1924501dd071b25b --- /dev/null +++ b/103120/json_schema/TS_103_120_notification.json @@ -0,0 +1,69 @@ +{ + "$id": "TS_103_120_notification.json", + "$defs": { + "NotificationObject": { + "type": "object", + "properties": { + "xsiType": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2016/02/Notification}NotificationObject" + }, + "ObjectIdentifier": { + "$ref": "TS_103_120_core.json#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "TS_103_120_core.json#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "TS_103_120_core.json#/$defs/NationalHandlingParameters" + }, + "NotificationDetails": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "NotificationType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "NewNotification": { + "type": "boolean" + }, + "NotificationTimestamp": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalNotificationParameters": { + "$ref": "#/$defs/NationalNotificationParameters" + } + }, + "required": [ + "xsiType", + "ObjectIdentifier" + ] + }, + "NationalNotificationParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/json_schema/TS_103_120_task.json b/103120/json_schema/TS_103_120_task.json new file mode 100644 index 0000000000000000000000000000000000000000..9145098a1c9b07846c4c32037e20e3689d97ed36 --- /dev/null +++ b/103120/json_schema/TS_103_120_task.json @@ -0,0 +1,532 @@ +{ + "$id": "TS_103_120_task.json", + "$defs": { + "LITaskObject": { + "type": "object", + "properties": { + "xsiType": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject" + }, + "ObjectIdentifier": { + "$ref": "TS_103_120_core.json#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "TS_103_120_core.json#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "TS_103_120_core.json#/$defs/NationalHandlingParameters" + }, + "Reference": { + "$ref": "etsi103280.json#/$defs/LIID" + }, + "Status": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "DesiredStatus": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "Timespan": { + "$ref": "#/$defs/TaskTimespan" + }, + "TargetIdentifier": { + "$ref": "#/$defs/TargetIdentifier" + }, + "DeliveryType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "DeliveryDetails": { + "$ref": "#/$defs/TaskDeliveryDetails" + }, + "ApprovalDetails": { + "type": "array", + "items": { + "$ref": "TS_103_120_common.json#/$defs/ApprovalDetails" + } + }, + "CSPID": { + "$ref": "TS_103_120_core.json#/$defs/EndpointID" + }, + "HandlingProfile": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "InvalidReason": { + "$ref": "TS_103_120_core.json#/$defs/ActionUnsuccesfulInformation" + }, + "Flags": { + "$ref": "#/$defs/TaskFlags" + }, + "NationalLITaskingParameters": { + "$ref": "#/$defs/NationalLITaskingParameters" + } + }, + "required": [ + "xsiType", + "ObjectIdentifier" + ] + }, + "TaskTimespan": { + "type": "object", + "properties": { + "StartTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "EndTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "TerminationTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "ProvisioningTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "DeprovisioningTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "TargetIdentifier": { + "type": "object", + "properties": { + "TargetIdentifierValues": { + "$ref": "#/$defs/TargetIdentifierValues" + }, + "ServiceType": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + } + }, + "required": [] + }, + "TargetIdentifierValues": { + "type": "object", + "properties": { + "TargetIdentifierValue": { + "type": "array", + "items": { + "$ref": "#/$defs/TargetIdentifierValue" + }, + "minItems": 1 + } + }, + "required": [] + }, + "TargetIdentifierValue": { + "type": "object", + "properties": { + "FormatType": { + "$ref": "#/$defs/FormatType" + }, + "Value": { + "$ref": "etsi103280.json#/$defs/LongString" + } + }, + "required": [ + "FormatType", + "Value" + ] + }, + "FormatType": { + "type": "object", + "properties": { + "FormatOwner": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "FormatName": { + "$ref": "etsi103280.json#/$defs/ShortString" + } + }, + "required": [ + "FormatOwner", + "FormatName" + ] + }, + "TaskDeliveryDetails": { + "type": "object", + "properties": { + "DeliveryDestination": { + "type": "array", + "items": { + "$ref": "#/$defs/DeliveryDestination" + }, + "minItems": 1 + } + }, + "required": [] + }, + "DeliveryDestination": { + "type": "object", + "properties": { + "DeliveryAddress": { + "$ref": "#/$defs/DeliveryAddress" + }, + "EncryptionDetails": { + "$ref": "#/$defs/NationalEncryptionDetails" + }, + "IRIorCC": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "HandoverFormat": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "DeliveryProfile": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "NationalDeliveryParameters": { + "$ref": "#/$defs/NationalDeliveryParameters" + } + }, + "required": [] + }, + "DeliveryAddress": { + "oneOf": [ + { + "type": "object", + "properties": { + "IPv4Address": { + "$ref": "etsi103280.json#/$defs/IPv4Address" + } + }, + "required": [ + "IPv4Address" + ] + }, + { + "type": "object", + "properties": { + "IPv6Address": { + "$ref": "etsi103280.json#/$defs/IPv6Address" + } + }, + "required": [ + "IPv6Address" + ] + }, + { + "type": "object", + "properties": { + "IPAddressPort": { + "$ref": "etsi103280.json#/$defs/IPAddressPort" + } + }, + "required": [ + "IPAddressPort" + ] + }, + { + "type": "object", + "properties": { + "IPAddressPortRange": { + "$ref": "etsi103280.json#/$defs/IPAddressPortRange" + } + }, + "required": [ + "IPAddressPortRange" + ] + }, + { + "type": "object", + "properties": { + "E164Number": { + "$ref": "etsi103280.json#/$defs/InternationalE164" + } + }, + "required": [ + "E164Number" + ] + }, + { + "type": "object", + "properties": { + "FTPAddress": { + "type": "string" + } + }, + "required": [ + "FTPAddress" + ] + }, + { + "type": "object", + "properties": { + "URL": { + "type": "string" + } + }, + "required": [ + "URL" + ] + }, + { + "type": "object", + "properties": { + "FQDN": { + "$ref": "etsi103280.json#/$defs/LongString" + } + }, + "required": [ + "FQDN" + ] + }, + { + "type": "object", + "properties": { + "EmailAddress": { + "$ref": "etsi103280.json#/$defs/EmailAddress" + } + }, + "required": [ + "EmailAddress" + ] + } + ] + }, + "TaskFlags": { + "type": "object", + "properties": { + "TaskFlag": { + "type": "array", + "items": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, + "NationalLITaskingParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + }, + "NationalDeliveryParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + }, + "NationalEncryptionDetails": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + }, + "LDTaskObject": { + "type": "object", + "properties": { + "xsiType": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Task}LDTaskObject" + }, + "ObjectIdentifier": { + "$ref": "TS_103_120_core.json#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "etsi103280.json#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "etsi103280.json#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "TS_103_120_core.json#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "TS_103_120_core.json#/$defs/NationalHandlingParameters" + }, + "Reference": { + "$ref": "etsi103280.json#/$defs/LDID" + }, + "Status": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "StatusReason": { + "$ref": "TS_103_120_core.json#/$defs/ActionUnsuccesfulInformation" + }, + "DesiredStatus": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "RequestDetails": { + "$ref": "#/$defs/RequestDetails" + }, + "DeliveryDetails": { + "$ref": "#/$defs/LDDeliveryDetails" + }, + "ApprovalDetails": { + "type": "array", + "items": { + "$ref": "TS_103_120_common.json#/$defs/ApprovalDetails" + } + }, + "CSPID": { + "$ref": "TS_103_120_core.json#/$defs/EndpointID" + }, + "HandlingProfile": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "Flags": { + "$ref": "#/$defs/LDTaskFlags" + }, + "NationalLDTaskingParameters": { + "$ref": "#/$defs/NationalLDTaskingParameters" + } + }, + "required": [ + "xsiType", + "ObjectIdentifier" + ] + }, + "RequestDetails": { + "type": "object", + "properties": { + "Type": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "StartTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "EndTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "ObservedTime": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + }, + "ObservedTimes": { + "type": "array", + "items": { + "$ref": "etsi103280.json#/$defs/QualifiedDateTime" + } + }, + "RequestValues": { + "$ref": "#/$defs/RequestValues" + } + }, + "required": [] + }, + "RequestValues": { + "type": "object", + "properties": { + "RequestValue": { + "type": "array", + "items": { + "$ref": "#/$defs/RequestValue" + }, + "minItems": 1 + } + }, + "required": [] + }, + "RequestValue": { + "type": "object", + "properties": { + "FormatType": { + "$ref": "#/$defs/FormatType" + }, + "Value": { + "$ref": "etsi103280.json#/$defs/LongString" + } + }, + "required": [ + "FormatType", + "Value" + ] + }, + "LDDeliveryDetails": { + "type": "object", + "properties": { + "LDDeliveryDestination": { + "type": "array", + "items": { + "$ref": "#/$defs/LDDeliveryDestination" + }, + "minItems": 1 + } + }, + "required": [] + }, + "LDDeliveryDestination": { + "type": "object", + "properties": { + "DeliveryAddress": { + "$ref": "#/$defs/DeliveryAddress" + }, + "EncryptionDetails": { + "$ref": "#/$defs/NationalEncryptionDetails" + }, + "LDHandoverFormat": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "LDDeliveryProfile": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + }, + "NationalDeliveryParameters": { + "$ref": "#/$defs/NationalDeliveryParameters" + } + }, + "required": [] + }, + "LDTaskFlags": { + "type": "object", + "properties": { + "LDTaskFlag": { + "type": "array", + "items": { + "$ref": "TS_103_120_common.json#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, + "NationalLDTaskingParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "etsi103280.json#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103280/TS_103_280.json b/103280/TS_103_280.json new file mode 100644 index 0000000000000000000000000000000000000000..09457bda764490bfe0c6ec6e8dc8a61c6d92cbe5 --- /dev/null +++ b/103280/TS_103_280.json @@ -0,0 +1,384 @@ +{ + "$id": "etsi103280.json", + "$defs": { + "ShortString": { + "type": "string", + "maxLength": 255 + }, + "LongString": { + "type": "string", + "maxLength": 65535 + }, + "LIID": { + "type": "string", + "pattern": "^([!-~]{1,25})|([0-9a-f]{26,50})$" + }, + "UTCDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$" + }, + "UTCMicrosecondDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$" + }, + "QualifiedDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "QualifiedMicrosecondDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "InternationalE164": { + "type": "string", + "pattern": "^[0-9]{1,15}$" + }, + "IMSI": { + "type": "string", + "pattern": "^[0-9]{6,15}$" + }, + "IMEI": { + "type": "string", + "pattern": "^[0-9]{14}$" + }, + "IMEICheckDigit": { + "type": "string", + "pattern": "^[0-9]{15}$" + }, + "IMEISV": { + "type": "string", + "pattern": "^[0-9]{16}$" + }, + "IPv4Address": { + "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])$" + }, + "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])$" + }, + "IPv6Address": { + "type": "string", + "pattern": "^([0-9a-f]{4}:){7}([0-9a-f]{4})$" + }, + "IPv6CIDR": { + "type": "string", + "pattern": "^([0-9a-f]{4}:){7}([0-9a-f]{4})/(([1-9][0-9]?)|(1[0-1][0-9])|(12[0-8]))$" + }, + "TCPPort": { + "type": "integer", + "exclusiveMinimum": 1, + "maximum": 65535 + }, + "UDPPort": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "MACAddress": { + "type": "string", + "pattern": "^([a-f0-9]{2}:){5}[a-f0-9]{2}$" + }, + "EmailAddress": { + "allOf": [ + { + "$ref": "#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^[a-zA-Z0-9\\.!#$%&'\\*\\+\\\\/=\\?\\^_`\\{\\|\\}~\\-]+@[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$" + } + ] + }, + "UUID": { + "type": "string", + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + }, + "ISOCountryCode": { + "type": "string", + "pattern": "^[A-Z]{2}$" + }, + "SIPURI": { + "type": "string", + "pattern": "^sips?:[a-zA-Z0-9!#$&-;=?-\\[\\]_~%]+$" + }, + "TELURI": { + "type": "string", + "pattern": "^tel:[a-zA-Z0-9!#$&-;=?-\\[\\]_~%]+$" + }, + "WGS84LatitudeDecimal": { + "type": "string", + "pattern": "^[NS][0-9]{2}\\.[0-9]{6}$" + }, + "WGS84LongitudeDecimal": { + "type": "string", + "pattern": "^[EW][0-9]{3}\\.[0-9]{6}$" + }, + "WGS84LatitudeAngular": { + "type": "string", + "pattern": "^[NS][0-9]{6}\\.[0-9]{2}$" + }, + "WGS84LongitudeAngular": { + "type": "string", + "pattern": "^[EW][0-9]{7}\\.[0-9]{2}$" + }, + "SUPIIMSI": { + "$ref": "#/$defs/IMSI" + }, + "SUPINAI": { + "$ref": "#/$defs/NAI" + }, + "SUCI": { + "type": "string", + "pattern": "^([a-fA-F0-9]{2})*$" + }, + "PEIIMEI": { + "$ref": "#/$defs/IMEI" + }, + "PEIIMEICheckDigit": { + "$ref": "#/$defs/IMEICheckDigit" + }, + "PEIIMEISV": { + "$ref": "#/$defs/IMEISV" + }, + "GPSIMSISDN": { + "type": "string", + "pattern": "^[0-9]{1,15}$" + }, + "GPSINAI": { + "$ref": "#/$defs/NAI" + }, + "NAI": { + "type": "string" + }, + "LDID": { + "type": "string", + "pattern": "^([A-Z]{2}-.+-.+)$" + }, + "InternationalizedEmailAddress": { + "allOf": [ + { + "$ref": "#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^.+@.+$" + } + ] + }, + "EUI64": { + "type": "string", + "pattern": "^([a-f0-9]{2}:){7}[a-f0-9]{2}$" + }, + "CGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{4}-[a-f0-9]{4}$" + }, + "ECGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{7}$" + }, + "NCGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{9}$" + }, + "ICCID": { + "type": "string", + "pattern": "^[0-9]{19,20}$" + }, + "IPAddress": { + "oneOf": [ + { + "type": "object", + "properties": { + "IPv4Address": { + "$ref": "#/$defs/IPv4Address" + } + }, + "required": [ + "IPv4Address" + ] + }, + { + "type": "object", + "properties": { + "IPv6Address": { + "$ref": "#/$defs/IPv6Address" + } + }, + "required": [ + "IPv6Address" + ] + } + ] + }, + "IPCIDR": { + "oneOf": [ + { + "type": "object", + "properties": { + "IPv4CIDR": { + "$ref": "#/$defs/IPv4CIDR" + } + }, + "required": [ + "IPv4CIDR" + ] + }, + { + "type": "object", + "properties": { + "IPv6CIDR": { + "$ref": "#/$defs/IPv6CIDR" + } + }, + "required": [ + "IPv6CIDR" + ] + } + ] + }, + "TCPPortRange": { + "type": "object", + "properties": { + "start": { + "$ref": "#/$defs/TCPPort" + }, + "end": { + "$ref": "#/$defs/TCPPort" + } + }, + "required": [ + "start", + "end" + ] + }, + "UDPPortRange": { + "type": "object", + "properties": { + "start": { + "$ref": "#/$defs/UDPPort" + }, + "end": { + "$ref": "#/$defs/UDPPort" + } + }, + "required": [ + "start", + "end" + ] + }, + "Port": { + "oneOf": [ + { + "type": "object", + "properties": { + "TCPPort": { + "$ref": "#/$defs/TCPPort" + } + }, + "required": [ + "TCPPort" + ] + }, + { + "type": "object", + "properties": { + "UDPPort": { + "$ref": "#/$defs/UDPPort" + } + }, + "required": [ + "UDPPort" + ] + } + ] + }, + "PortRange": { + "oneOf": [ + { + "type": "object", + "properties": { + "TCPPortRange": { + "$ref": "#/$defs/TCPPortRange" + } + }, + "required": [ + "TCPPortRange" + ] + }, + { + "type": "object", + "properties": { + "UDPPortRange": { + "$ref": "#/$defs/UDPPortRange" + } + }, + "required": [ + "UDPPortRange" + ] + } + ] + }, + "IPAddressPort": { + "type": "object", + "properties": { + "address": { + "$ref": "#/$defs/IPAddress" + }, + "port": { + "$ref": "#/$defs/Port" + } + }, + "required": [ + "address", + "port" + ] + }, + "IPAddressPortRange": { + "type": "object", + "properties": { + "address": { + "$ref": "#/$defs/IPAddress" + }, + "portRange": { + "$ref": "#/$defs/PortRange" + } + }, + "required": [ + "address", + "portRange" + ] + }, + "WGS84CoordinateDecimal": { + "type": "object", + "properties": { + "latitude": { + "$ref": "#/$defs/WGS84LatitudeDecimal" + }, + "longitude": { + "$ref": "#/$defs/WGS84LongitudeDecimal" + } + }, + "required": [ + "latitude", + "longitude" + ] + }, + "WGS84CoordinateAngular": { + "type": "object", + "properties": { + "latitude": { + "$ref": "#/$defs/WGS84LatitudeAngular" + }, + "longitude": { + "$ref": "#/$defs/WGS84LongitudeAngular" + } + }, + "required": [ + "latitude", + "longitude" + ] + } + } +} \ No newline at end of file diff --git a/testing/json_compile_targets.json b/testing/json_compile_targets.json new file mode 100644 index 0000000000000000000000000000000000000000..86b2d253a9bf841dd58c081ca2050da2134a74ad --- /dev/null +++ b/testing/json_compile_targets.json @@ -0,0 +1,20 @@ +[ + { + "coreSchema" : "./103280/TS_103_280.json", + "supportingSchemas" : [], + "exampleFiles" : [] + }, + { + "coreSchema" : "./103120/json_schema/TS_103_120_core.json", + "supportingSchemas" : [ + "./103120/json_schema/TS_103_120_authorisation.json", + "./103120/json_schema/TS_103_120_common.json", + "./103120/json_schema/TS_103_120_document.json", + "./103120/json_schema/TS_103_120_notification.json", + "./103120/json_schema/TS_103_120_task.json", + "./103120/json_schema/TS_103_120_delivery.json", + "./103280/TS_103_280.json" + ], + "exampleFiles" : ["./103120/json_examples/"] + } +] \ No newline at end of file diff --git a/testing/json_process.py b/testing/json_process.py new file mode 100644 index 0000000000000000000000000000000000000000..6eaed052d280c4382d24c262c7c95a250f3be98d --- /dev/null +++ b/testing/json_process.py @@ -0,0 +1,43 @@ +import logging +import json +from pathlib import Path + +import jsonschema + +def get_json(filename: str): + with open(filename) as f: + j = json.load(f) + return j + + +logging.basicConfig(level=logging.DEBUG) +if __name__ == "__main__": + targets = get_json("testing/json_compile_targets.json") + + resolver=None + for target in targets: + logging.info(f"Testing {target['coreSchema']}") + schema = get_json(target['coreSchema']) + + supporting_schemas = {schema['$id'] : schema} + for supporting_schema in target['supportingSchemas']: + js = get_json(supporting_schema) + supporting_schemas[js['$id']] = js + if len(supporting_schemas.keys()) > 0: + ref_resolver = jsonschema.RefResolver("", "", supporting_schemas) + print(supporting_schemas.keys()) + else: + ref_resolver = None + + # validator = jsonschema.Draft202012Validator(schema, resolver=resolver) + + for example_dir in target['exampleFiles']: + for example_file in Path(example_dir).rglob("*.json"): + instance = get_json(example_file) + jsonschema.validate(instance, schema, resolver = ref_resolver) + # for err in validator.iter_errors(instance): + # print(err.message) + logging.info("Done testing") + + +# print(json.dumps(js, indent=2)) \ No newline at end of file diff --git a/translation/translate/ChoiceMapping.py b/translation/translate/ChoiceMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..fecadf80b0ee77959b917f1bcdec95495bd20371 --- /dev/null +++ b/translation/translate/ChoiceMapping.py @@ -0,0 +1,42 @@ +import logging + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +from .TypeMapping import TypeMapping +from .ComplexTypeMapping import ComplexTypeMapping + +log = logging.getLogger() + +class ChoiceMapping(ComplexTypeMapping): + @classmethod + def process_choice(cls, choice: XsdGroup, current_ns : str): + if choice.model != 'choice': + raise Exception(f"Wrong group type: {c.model}") + oneOf = [] + for c in choice.iter_model(): + if not (type(c) is XsdElement): + raise Exception (f"Non-element {c} encountered in choice {choice}") + t = TypeMapping.get_type_from_elem(c, current_ns) + oneOf.append({ + "type" : "object", + "properties" : { + c.local_name : t + }, + "required" : [c.local_name] + }) + return oneOf + + def map(self, xst : BaseXsdType): + log.debug(f"Attempting mapping of {xst} to choice") + j = super().map(xst) + if j is None: + log.debug("Not a complex type, giving up") + return None + content = xst.content + if (content.model != 'choice'): + log.debug("Not a choice, giving up") + return None + return { 'oneOf' : ChoiceMapping.process_choice(content, xst.namespaces[''])} diff --git a/translation/translate/ComplexTypeMapping.py b/translation/translate/ComplexTypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..e18190901be2c3e0695c00a772be5364cce591d1 --- /dev/null +++ b/translation/translate/ComplexTypeMapping.py @@ -0,0 +1,11 @@ +from xmlschema.validators.complex_types import * + +from .TypeMapping import TypeMapping + +class ComplexTypeMapping(TypeMapping): + def map(self, xst: BaseXsdType): + if not (type(xst) is XsdComplexType): + return None + return { + "type" : "object" + } diff --git a/translation/translate/SequenceMapping.py b/translation/translate/SequenceMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..6bb4ca3ce09c37259add4f32e711ccd4358b3122 --- /dev/null +++ b/translation/translate/SequenceMapping.py @@ -0,0 +1,80 @@ +import logging + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +from .TypeMapping import TypeMapping +from .ChoiceMapping import ChoiceMapping +from .ComplexTypeMapping import ComplexTypeMapping + +log = logging.getLogger() + + +class SequenceMapping(ComplexTypeMapping): + def map(self, xst: BaseXsdType): + log.debug(f"Attempting mapping of {xst} to sequence") + j = super().map(xst) + if j is None: + log.debug("Not a complex type, giving up") + return None + content = xst.content + if (content.model != 'sequence'): + log.debug("Not a sequence, giving up") + return None + mapped_type = { + 'type' : 'object', + 'properties' : {}, + 'required' : [] + } + + # Not going to try and do all of this automatically for now + # Only make insert the xsiType parameter + if (xst.base_type): + # mapped_type['__DESCENDENT_OF__'] = TypeMapping.get_ref_for(xst.base_type, xst.namespaces['']) + mapped_type['properties']['xsiType'] = { + "type" : "string", + "enum" : xst.name + } + mapped_type['required'].append('xsiType') + # if xst.abstract: + # mapped_type['__ABSTRACT__'] = True + # pass + + inner_choice = None + for c in list(content.iter_model()): + log.debug(f"Processing model item {c}") + if type(c) is XsdElement: + if c.effective_max_occurs != 1: + mapped_type['properties'][c.local_name] = { + "type" : "array", + "items" : TypeMapping.get_type_from_elem(c, xst.namespaces['']) + } + if c.effective_max_occurs: + mapped_type['properties'][c.local_name]['maxItems'] = c.effective_max_occurs + if c.effective_min_occurs > 0: + mapped_type['properties'][c.local_name]['minItems'] = c.effective_min_occurs + else: + mapped_type['properties'][c.local_name] = TypeMapping.get_type_from_elem(c, xst.namespaces['']) + if c.effective_min_occurs == 1: + mapped_type['required'].append(c.local_name) + elif type(c) is XsdGroup: + if inner_choice: + raise Exception (f"Second group '{c.local_name}' encountered in {xst}") + if c.model != "choice": + raise Exception (f"Don't know what to do with inner group {c} in {xst} - not a choice") + inner_choice = ChoiceMapping.process_choice(c, xst.namespaces['']) + elif type(c) is XsdAnyElement: + mapped_type = {} + else: + raise Exception(f"Unknown element type {c}") + if (inner_choice): + return { + 'allOf' : [ + mapped_type, + {'oneOf' : inner_choice} + ] + } + else: + return mapped_type diff --git a/translation/translate/SimpleTypeMapping.py b/translation/translate/SimpleTypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..2e60f9ca06b321a28992c2a32235707671f95735 --- /dev/null +++ b/translation/translate/SimpleTypeMapping.py @@ -0,0 +1,18 @@ +import logging + +from xmlschema.validators.complex_types import * +from xmlschema.validators.simple_types import XsdAtomicRestriction + +from .TypeMapping import TypeMapping + +log = logging.getLogger() + +class SimpleTypeMapping(TypeMapping): + def map(self, xst: BaseXsdType): + log.debug(f"Attempting mapping of {xst} to simple type") + if not (type(xst) is XsdAtomicRestriction): + log.debug("Type is not an XsdAtomicRestriction, giving up") + return None + return { + "$ref" : xst.base_type.name + } \ No newline at end of file diff --git a/translation/translate/TypeMapping.py b/translation/translate/TypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..57fa0edfe06852ce06c8c9dec35683ed8eb57dbd --- /dev/null +++ b/translation/translate/TypeMapping.py @@ -0,0 +1,69 @@ +import logging +from abc import ABC, abstractmethod + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +log = logging.getLogger() + +class TypeMapping(ABC): + ns_to_id_map = {} + + XSD_NS = "http://www.w3.org/2001/XMLSchema" + + XSD_TYPE_MAP = { + "string" : { "type" : "string" }, + "normalizedString" : { "type" : "string", "pattern" : "^[^\r\n\t]*$"}, + "dateTime" : { "type" : "string"}, + "token" : { "type" : "string", "pattern" : "^[^\r\n\t]*$"}, + "anyURI" : { "type" : "string" }, + + "integer" : { "type" : "integer"}, + "nonNegativeInteger" : { "type" : "integer", "minimum" : 0}, + + "boolean" : { "type" : "boolean" }, + + "hexBinary" : { "type" : "string", "pattern" : "^([a-fA-F0-9]{2})*$"}, + "base64Binary" : { "type" : "string", "pattern" : "^[-A-Za-z0-9+/]*={0,3}$"}, + + "anyType" : {} + } + + @abstractmethod + def map(self, xst : BaseXsdType): + return None + + @classmethod + def extract_namespace(cls, qname: str): + match = re.search(r'^\{([^\{\}]+)\}(([^\{\}]+))$', qname) + if match is None: + return None + return match.group(1) + + @classmethod + def get_ref_for(cls, xsd_type: XsdType, current_ns : str): + ns = cls.extract_namespace(xsd_type.name) + if ns == current_ns: + return { "$ref" : f"#/$defs/{xsd_type.local_name}" } + else: + mapped_id = cls.ns_to_id_map[ns] + return { "$ref" : f"{mapped_id}#/$defs/{xsd_type.local_name}"} + + @classmethod + def get_type_from_elem(cls, elem: XsdElement, current_ns : str): + ns = cls.extract_namespace(elem.type.name) + if (ns == TypeMapping.XSD_NS): + # this should be an XSD primitive type + return dict(TypeMapping.XSD_TYPE_MAP[elem.type.local_name]) + else: + return cls.get_ref_for(elem.type, current_ns) + + + + + + + + diff --git a/translation/translate/XSDNativeSimpleTypeMapping.py b/translation/translate/XSDNativeSimpleTypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..772ac10b308d4c2128bcf1bac3271117d9bbe80e --- /dev/null +++ b/translation/translate/XSDNativeSimpleTypeMapping.py @@ -0,0 +1,72 @@ +import logging + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +from .TypeMapping import TypeMapping +from .SimpleTypeMapping import SimpleTypeMapping + +log = logging.getLogger() + +class XSDNativeSimpleTypeMapping(SimpleTypeMapping): + + def map(self, xst: BaseXsdType): + log.debug(f"Attempting mapping of {xst} to XSD native type") + j = super().map(xst) + if j is None: + log.debug("Not a simple type, giving up") + return None + + mapped_type = TypeMapping.XSD_TYPE_MAP.get(xst.base_type.local_name) + parent_type = None + + if mapped_type is None: + ns = TypeMapping.extract_namespace(xst.base_type.name) + if ns == XSDNativeSimpleTypeMapping.XSD_NS: + print (xst) + print (xst.base_type) + raise Exception (f"No mapping for xs:{xst.base_type.local_name}") + if len(xst.facets) == 0: + mapped_type = TypeMapping.get_ref_for(xst.base_type, xst.namespaces['']) + else: + parent_type = TypeMapping.get_ref_for(xst.base_type, xst.namespaces['']) + mapped_type = TypeMapping.XSD_TYPE_MAP.get(xst.root_type.local_name) + if mapped_type is None: + raise Exception (f"Could not find mapping for root type xs:{xst.root_type.local_name}") + + mapped_type = dict(mapped_type) + + for k, v in xst.facets.items(): + log.debug(f"Mapping facet {v}") + if type(v) is XsdMaxLengthFacet: + mapped_type['maxLength'] = v.value + continue + if type(v) is XsdMinLengthFacet: + mapped_type['minLength'] = v.value + continue + if type(v) is XsdPatternFacets: + if len(v.regexps) > 1: + raise Exception (f"Multiple patterns given in facet {v} of {xst}") + p = v.regexps[0] + if (not p.startswith('^')) and (not p.endswith('$')): + p = f"^{p}$" + mapped_type['pattern'] = p + continue + if type (v) is XsdMinInclusiveFacet: + mapped_type['minimum'] = v.value + continue + if type (v) is XsdMaxInclusiveFacet: + mapped_type['maximum'] = v.value + continue + if type (v) is XsdMinExclusiveFacet: + mapped_type['exclusiveMinimum'] = v.value + continue + if type (v) is XsdMaxExclusiveFacet: + mapped_type['exclusiveMaximum'] = v.value + continue + raise Exception (f"Unhandled facet {v}") + if parent_type: + return { 'allOf' : [parent_type, mapped_type] } + return mapped_type diff --git a/translation/translate/__init__.py b/translation/translate/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b56a382ab06035a63d7f150a3c11d01d8280c737 --- /dev/null +++ b/translation/translate/__init__.py @@ -0,0 +1,63 @@ +import logging +from numbers import Complex +from pathlib import Path + +from xmlschema import * + +from .TypeMapping import * +from .XSDNativeSimpleTypeMapping import XSDNativeSimpleTypeMapping +from .ChoiceMapping import ChoiceMapping +from .SequenceMapping import SequenceMapping + + +log = logging.getLogger() + +mappings = [ + XSDNativeSimpleTypeMapping(), + ChoiceMapping(), + SequenceMapping(), +] + +def translate_schema (schema_path: str, ns_to_id_map: dict, schema_locations = []): + js = { + "$id" : "?", + "$defs" : {} + } + + logging.info(f"Translating schema {schema_path}") + xs = XMLSchema(schema_path, validation='lax', locations=schema_locations) + logging.info(f"Schema namespace: {xs.target_namespace}" ) + + schema_id = ns_to_id_map[xs.target_namespace] + js['$id'] = schema_id + + TypeMapping.ns_to_id_map = ns_to_id_map + + elementList = [] + for elementName, element in xs.elements.items(): + logging.info(f"Processing element {elementName} : {element}") + elementList.append(TypeMapping.get_ref_for(element.type, element.namespaces[''])) + if len(elementList) == 1: + js['$ref'] = elementList[0]['$ref'] + elif len(elementList) > 1: + js['oneOf'] = elementList + + descendent_types = {} + for type_name, xsd_type in xs.types.items(): + logging.info(f"Processing {type_name} : {xsd_type}") + + j = None + for mapping in mappings: + log.debug("\n----------------------------------------") + j = mapping.map(xsd_type) + if j is None: + continue + else: + break + if j is None: + raise Exception(f"Unmapped type {type_name} ({xsd_type})") + js["$defs"][xsd_type.local_name] = j + logging.debug (f"Mapped {type_name} to {j}") + + print (descendent_types) + return js \ No newline at end of file diff --git a/translation/translate_120.py b/translation/translate_120.py new file mode 100644 index 0000000000000000000000000000000000000000..5d4b2ab6ca76e80f3678edc1e7031819adf7dcb0 --- /dev/null +++ b/translation/translate_120.py @@ -0,0 +1,97 @@ +import json +import logging +import os +from pathlib import Path +import sys + +from xmlschema import * + +from translate import * + +import jsonschema + +logging.basicConfig(level = logging.INFO) + +def build_schema_locations (paths): + schema_locations = [] + for schemaFile in paths: + try: + xs = XMLSchema(schemaFile, validation='skip') + schema_locations.append((xs.target_namespace, str(Path(schemaFile).resolve()))) + print (" [ {0} -> {1} ]".format(xs.target_namespace, schemaFile)) + except XMLSchemaParseError as ex: + print (" [ {0} failed to parse: {1} ]".format(schemaFile, ex)) + return schema_locations + + + +if __name__ == "__main__": + schema_paths = [ "103120/schema/ts_103120_Authorisation.xsd", + "103120/schema/ts_103120_Common.xsd", + "103120/schema/ts_103120_Core.xsd", + "103120/schema/ts_103120_Delivery.xsd", + "103120/schema/ts_103120_Document.xsd", + "103120/schema/ts_103120_Notification.xsd", + "103120/schema/ts_103120_Task.xsd", + "103280/TS_103_280.xsd", + "testing/deps/xmldsig/xmldsig-core-schema.xsd"] + + schema_locations = build_schema_locations(schema_paths) + + ns_to_id_map = { + schema[0]: "TS_103_120_" + schema[0].split('/')[-1].lower() + ".json" + for schema in schema_locations if '03120' in schema[0] + } | { + 'http://uri.etsi.org/03280/common/2017/07' : 'etsi103280.json', + 'http://www.w3.org/2000/09/xmldsig#' : 'xmldsig.json', + } + + # js = translate_schema("103280/TS_103_280.xsd", "103120.json") + # print(json.dumps(js, indent=2)) + + output_path = Path('103120/json_schema') + if not output_path.exists(): + os.mkdir(str(output_path)) + + json_schemas = {} + for schema_tuple in schema_locations: + if 'xmldsig' in (schema_tuple[1]): + continue + js = translate_schema(schema_tuple[1], ns_to_id_map, schema_locations) + if ns_to_id_map[schema_tuple[0]] == 'core.json': + js['$defs']['HI1Message']['properties'].pop('Signature') + js_path = output_path / ns_to_id_map[schema_tuple[0]] + + if "Core" in schema_tuple[1]: + js["$defs"]['OneOfHI1Object'] = { + 'oneOf' : [ + {'$ref' : 'TS_103_120_authorisation.json#/$defs/AuthorisationObject'}, + {'$ref' : 'TS_103_120_task.json#/$defs/LITaskObject'}, + {'$ref' : 'TS_103_120_task.json#/$defs/LDTaskObject'}, + {'$ref' : 'TS_103_120_document.json#/$defs/DocumentObject'}, + {'$ref' : 'TS_103_120_notification.json#/$defs/NotificationObject'}, + ] + } + + json_string = json.dumps(js, indent=2) + + if "Core" in schema_tuple[1]: + json_string = json_string.replace('"$ref": "#/$defs/HI1Object"', '"$ref": "#/$defs/OneOfHI1Object"') + + if "TS_103_120" in str(js_path): + with open(str(js_path), 'w') as f: + f.write(json_string) + # json_schemas[js['$id']] = json.loads(json_string) + # else: + # json_schemas = {} + # json_path = Path('103120/json_schema') + # for json_file in json_path.glob("*.json"): + # json_schemas[json_file.name] = get_json(json_file) + + # resolver = jsonschema.RefResolver("", "", json_schemas) + + # instance = get_json("120.json") + # schema = json_schemas['core.json'] + # jsonschema.validate(instance, schema, resolver=resolver) + + # # print(json.dumps(js, indent=2))