Commit 77fc0026 authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Rebasing previous draft branch

parent 8d155ebd
Loading
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
{
  "$id": "example.com_csp-a-schema_1.2.3",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Example extended schema for CSP A. This CSP only ever has one person associated with a subscription - the account holder - and so composes a Subscription record from the ETSI-standard Subscription and PersonDetails entities",
  "allOf": [
    {
      "$ref": "http://etsi.org/temp/705"
    },
    {
      "type": "object",
      "properties": {
        "recordSet": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/definedRecords"
          }
        }
      },
      "required": [
        "recordSet"
      ]
    }
  ],
  "$defs": {
    "definedRecords": {
      "title" : "Defined Records",
      "description" : "Sets out what the valid set of Record types is for this CSP. It is expressed as a 'oneOf' list, each of which combines a type identifier and a reference to the type that is used to validate the record",
      "oneOf": [
        {
          "allOf": [
            {
              "type": "object",
              "title" : "Subscriber record",
              "description" : "Uses the ETSI-standard subscriber record (the first $ref), extended to include person details (the second $ref)",
              "properties": {
                "type": {
                  "const": "Subscription"
                }
              }
            },
            {
              "description" : "Uses the basic ETSI-standard subscriber record fields as a base",
              "$ref": "http://etsi.org/temp/705/entities#/$defs/Subscription"
            },
            {
              "description" : "Extends the basic ETSI standard subscriber record according to the definition in extendedSubscriberRecord",
              "$ref": "#/$defs/extendedSubscriberRecord"
            }
          ]
        }
      ]
    },
    "extendedSubscriberRecord" : {
      "title" : "Extended Subscriber Record",
      "description" : "Here CSP A can describe all the extra fields that they want to put in their subscriber record. In this case, they just add the details of the account holder using the ETSI-standard PersonDetails type",
      "properties" : {
        "title" : "Account Holder",
        "description" : "Name and date of birth of the account holder for the description",
        "accountHolder" : { "$ref" : "http://etsi.org/temp/705/entities#/$defs/PersonDetails"}
      },
      "required" : ["personDetails"]
    }
  }
}
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
{
    "recordSetDescription" : {
        "schemaId" : "etsi.org/ts_103_705/1.1.1",
        "resultSetId" : "788e190d-fb2e-416e-9798-12a66ebe0a1a",
        "queryReference" : "LDID_1",
        "created" : "2023-06-08T09:31:56.000000Z",
        "recordTypes" : {
            "Subscription" : "example.com_csp-a-schema_1.2.3#$defs/extendedSubscriberRecord"
        }
    },
    "recordSet" : [
        {
            "id" : "1e997322-b813-437b-b2e2-dae732f0cf7f",
            "type" : "Subscription",
            "subscriptionId" : "{unique CSP subscription ID}",
            "personDetails" : {
                "lastName" : "Last",
                "firstName" : "First"
            }
        }
    ]
}
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
import json
from pathlib import Path
+82 −0
Original line number Diff line number Diff line
{
  "$id": "etsi.org_ts103705_1.3.1_etsi-types",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ETSI TS 103 705 Types schema",
  "description": "JSON schema for ETSI-defined types (see clause 6.1 and Annex A)",
  "$defs": {
    "Pointer" : {
      "type" : "object",
      "title" : "Pointer",
      "description" : "Allows one Record in a RecordSet to point to data in another Record in the same Recordset. See clause 5.4 and Annex A.2.2",
      "properties" : {
        "destination" : {
          "type" : "string",
          "title" : "Pointer Destination",
          "description" : "Identifies the Record in the RecordSet containined the referred-to data (see clause 5.3.2 and A.2.2)"
        },
        "relationship" : {
          "type" : "string",
          "title" : "Relationship",
          "description" : "Indicates the nature of the relationship. Valid values should be indicated by the CSP schema"
        },
        "required" : ["destination"]
      }
    },
    "Subscription": {
      "type": "object",
      "title": "Subscription",
      "description": "Basic subscription record",
      "properties": {
        "subscriptionId": {
          "title" : "Subscription Identifier",
          "description" : "Unique identifier for a subscription within the CSP",
          "type": "string"
        },
        "startDate": {
          "title" : "Subscription Start Date",
          "description" : "Date that the subscription started",
          "$ref": "ts_103280_2017_07#/$defs/UTCDateTime"
        },
        "endDate": {
          "title" : "Subscription End Date",
          "description" : "Date that the subscription ended",
          "$ref": "ts_103280_2017_07#/$defs/UTCDateTime"
        }
      },
      "required" : ["subscriptionId"]
    },
    "PersonDetails": {
      "type": "object",
      "title": "Person Details",
      "description": "Details about a person",
      "properties": {
        "forename": {
          "title" : "Forename",
          "description" : "Forename(s)",
          "type": "string"
        },
        "middeName": {
          "title" : "First Name",
          "description" : "Middle name(s), given as a space-delimited string",
          "type": "string"
        },
        "lastName" : {
          "title" : "Family Name",
          "description" : "Family name(s)",
          "type" : "string"
        },
        "birthDate" : {
          "title" : "Date of Birth",
          "description" : "Date of birth (time part can be ignored)",
          "$ref" : "ts_103280_2017_07#/$defs/DateTime"
        },
        "gender" : {
          "title" : "Gender",
          "description" : "Gender of the person",
          "type" : "string"
        }
      },
      "required" : ["lastName"]
    }
  }
}
 No newline at end of file
+77 −0
Original line number Diff line number Diff line
{
  "$id": "etsi.org_ts103705_1.3.1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ETSI TS 103 705 Response",
  "description": "Overall Response structure, representing the results of a lawful disclosure query (see clause 5)",
  "type:": "object",
  "properties": {
    "recordSetDescription": {
      "$ref": "#/$defs/recordSetDescription"
    },
    "recordSet": {
      "$ref": "#/$defs/recordSet"
    }
  },
  "required": [
    "recordSetDescription",
    "recordSet"
  ],
  "$defs": {
    "recordSetDescription": {
      "type": "object",
      "title": "RecordSetDescription",
      "description": "Provides metadata about the records being delivered (see clause 5.2)",
      "properties": {
        "schemaId" : { "$ref" : "#/$defs/schemaId" },
        "resultSetId" : { "$ref" : "#/$defs/resultSetId"},
        "queryReference" : { "$ref" : "#/$defs/queryReference" },
        "created" : {"$ref" : "ts_103280_2017_07#/$defs/QualifiedMicrosecondDateTime"},
        "recordTypes" : {"$ref" : "#/$defs/recordTypes"}
      },
      "required": [
        "schemaId", "resultSetId", "queryReference", "created", "recordTypes"
      ]
    },
    "schemaId": {
      "type": "string"
    },
    "resultSetId": {
      "type": "string"
    },    
    "queryReference": {
      "type": "string"
    },    
    "recordSet": {
      "type": "array",
      "title": "RecordSet",
      "description": "RecordSet (see clause 5.3). Contains a set of Records.",
      "items": {
        "$ref": "#$defs/record"
      }
    },
    "recordTypes" : {
      "type" : "object",
      "title" : "RecordTypes",
      "description" : "Dictionary of types used by the Response document (see clause 5.2.6)"
    },
    "record": {
      "type": "object",
      "title": "Record",
      "description": "Response record (see clause 5.3)",
      "properties": {
        "id": {
          "title": "id",
          "description": "Unique identifier for the Record within the RecordSet (see clause 5.3.2).",
          "type": "string"
        },
        "type" : {
          "title" : "type",
          "description" : "Type identifier, shall be mapped to a schema reference via the recrdTypes map (see clauses 5.2.6 and 5.3.3)"
        }
      },
      "required": [
        "id", "type"
      ]
    }
  }
}
 No newline at end of file
Loading