Commit e123cba0 authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Initial thoughts

parent 01d89e19
Loading
Loading
Loading
Loading
+65 −0
Original line number Diff line number Diff line
{
  "$id": "http://example.com/csp_a/response",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Example CSP schema A for ETSI TS 103 705 response",
  "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
+19 −0
Original line number Diff line number Diff line
{
    "recordSetDescription" : {
        "typesUsed" : {
            "type1" : "uri://example.com/schema1.schema.json",
            "type2" : "uri://example.com/schema2.schema.json"
        }
    },
    "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
+98 −0
Original line number Diff line number Diff line
{
  "$id": "http://example.com/csp_a/response",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Example CSP schema A for ETSI TS 103 705 response",
  "description": "Example extended schema for CSP B. This CSP has multiple different types of person associated with a subscription (account holder and bill payer); since these are often the same person, they want to be able to normalise this properly. They do this using a Pointer.",
  "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, extended to include a pointer to a Person record",
              "properties": {
                "type": {
                  "const": "Subscription"
                }
              }
            },
            {
              "$ref": "http://etsi.org/temp/705/entities#/$defs/Subscription"
            },
            {
              "$ref": "#/$defs/extendedSubscriberRecord"
            }
          ]
        },
        {
          "allOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "const": "Person"
                }
              }
            },
            {
              "$ref": "http://etsi.org/temp/705/entities#/$defs/PersonDetails"
            }
          ]
        }
      ]
    },
    "extendedSubscriberRecord": {
      "properties": {
        "associatedPeople": {
          "title" : "Associated People",
          "description" : "A list of people associated with the subscription, together with their relationship",
          "type" : "array",
          "items" : {
            "allOf": [
              {
                "$ref": "http://etsi.org/temp/705/entities#/$defs/Pointer"
              },
              {
                "type": "object",
                "properties": {
                  "pointerType": {
                    "enum": [
                      "Account Holder",
                      "Bill Payer"
                    ]
                  }
                }
              }
            ]  
          }
        }
      },
      "required": [
        "associatedPeople"
      ]
    }
  }
}
 No newline at end of file
+28 −0
Original line number Diff line number Diff line
{
    "recordSetDescription" : {
        "typesUsed" : {
            "type1" : "uri://example.com/schema1.schema.json",
            "type2" : "uri://example.com/schema2.schema.json"
        }
    },
    "recordSet" : [
        {
            "id" : "Record1",
            "type" : "Subscription",
            "subscriptionId" : "{CSP B subscription identifier}",
            "associatedPeople" : [{
                "destination" : "Record2",
                "pointerType" : "Account Holder"
            },{
                "destination" : "Record2",
                "pointerType" : "Bill Payer"
            }]
        },
        {
            "id" : "Record2",
            "type" : "Person",
            "firstName" : "Bill",
            "lastName" : "Payer"
        }
    ]
}
 No newline at end of file
+387 −0
Original line number Diff line number Diff line
{ 
    "$id"         : "http://etsi.org/temp/280",
    "$schema"     : "https://json-schema.org/draft/2020-12/schema",
    "title"       : "ETSI TS 103 280 (temp)",
    "description" : "A stubbed version of TS 103 280 definitions (need a CR to 280 for this)",
    "$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
Loading