Commit 9858681d authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Adding per-record validator

parent 6e5100a2
Loading
Loading
Loading
Loading
+389 −0
Original line number Original line Diff line number Diff line
{
    "$id": "ts_103280_2017_07",
    "$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}$"
      },
      "IPProtocol": {
        "type": "integer",
        "minimum": 0,
        "maximum": 255
      },
      "IPAddress": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "etsi280:IPv4Address": {
                "$ref": "#/$defs/IPv4Address"
              }
            },
            "required": [
              "etsi280:IPv4Address"
            ]
          },
          {
            "type": "object",
            "properties": {
              "etsi280:IPv6Address": {
                "$ref": "#/$defs/IPv6Address"
              }
            },
            "required": [
              "etsi280:IPv6Address"
            ]
          }
        ]
      },
      "IPCIDR": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "etsi280:IPv4CIDR": {
                "$ref": "#/$defs/IPv4CIDR"
              }
            },
            "required": [
              "etsi280:IPv4CIDR"
            ]
          },
          {
            "type": "object",
            "properties": {
              "etsi280:IPv6CIDR": {
                "$ref": "#/$defs/IPv6CIDR"
              }
            },
            "required": [
              "etsi280:IPv6CIDR"
            ]
          }
        ]
      },
      "TCPPortRange": {
        "type": "object",
        "properties": {
          "etsi280:start": {
            "$ref": "#/$defs/TCPPort"
          },
          "etsi280:end": {
            "$ref": "#/$defs/TCPPort"
          }
        },
        "required": [
          "etsi280:start",
          "etsi280:end"
        ]
      },
      "UDPPortRange": {
        "type": "object",
        "properties": {
          "etsi280:start": {
            "$ref": "#/$defs/UDPPort"
          },
          "etsi280:end": {
            "$ref": "#/$defs/UDPPort"
          }
        },
        "required": [
          "etsi280:start",
          "etsi280:end"
        ]
      },
      "Port": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "etsi280:TCPPort": {
                "$ref": "#/$defs/TCPPort"
              }
            },
            "required": [
              "etsi280:TCPPort"
            ]
          },
          {
            "type": "object",
            "properties": {
              "etsi280:UDPPort": {
                "$ref": "#/$defs/UDPPort"
              }
            },
            "required": [
              "etsi280:UDPPort"
            ]
          }
        ]
      },
      "PortRange": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "etsi280:TCPPortRange": {
                "$ref": "#/$defs/TCPPortRange"
              }
            },
            "required": [
              "etsi280:TCPPortRange"
            ]
          },
          {
            "type": "object",
            "properties": {
              "etsi280:UDPPortRange": {
                "$ref": "#/$defs/UDPPortRange"
              }
            },
            "required": [
              "etsi280:UDPPortRange"
            ]
          }
        ]
      },
      "IPAddressPort": {
        "type": "object",
        "properties": {
          "etsi280:address": {
            "$ref": "#/$defs/IPAddress"
          },
          "etsi280:port": {
            "$ref": "#/$defs/Port"
          }
        },
        "required": [
          "etsi280:address",
          "etsi280:port"
        ]
      },
      "IPAddressPortRange": {
        "type": "object",
        "properties": {
          "etsi280:address": {
            "$ref": "#/$defs/IPAddress"
          },
          "etsi280:portRange": {
            "$ref": "#/$defs/PortRange"
          }
        },
        "required": [
          "etsi280:address",
          "etsi280:portRange"
        ]
      },
      "WGS84CoordinateDecimal": {
        "type": "object",
        "properties": {
          "etsi280:latitude": {
            "$ref": "#/$defs/WGS84LatitudeDecimal"
          },
          "etsi280:longitude": {
            "$ref": "#/$defs/WGS84LongitudeDecimal"
          }
        },
        "required": [
          "etsi280:latitude",
          "etsi280:longitude"
        ]
      },
      "WGS84CoordinateAngular": {
        "type": "object",
        "properties": {
          "etsi280:latitude": {
            "$ref": "#/$defs/WGS84LatitudeAngular"
          },
          "etsi280:longitude": {
            "$ref": "#/$defs/WGS84LongitudeAngular"
          }
        },
        "required": [
          "etsi280:latitude",
          "etsi280:longitude"
        ]
      }
    }
  }
 No newline at end of file
+1 −1
Original line number Original line Diff line number Diff line
{
{
  "$id": "http://example.com/csp_a/response",
  "$id": "example.com_csp-a-schema_1.2.3",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$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",
  "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": [
  "allOf": [
+6 −2
Original line number Original line Diff line number Diff line
{
{
    "recordSetDescription" : {
    "recordSetDescription" : {
        "typesUsed" : {
        "schemaId" : "etsi.org/ts_103_705/1.1.1",
            "Subscription" : "http://example.com/csp_a/response#/$defs/extendedSubscriberRecord"
        "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" : [
    "recordSet" : [

103705/examples/csp_b.schema.json

deleted100644 → 0
+0 −98
Original line number Original line 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
+0 −28
Original line number Original line Diff line number Diff line
{
    "recordSetDescription" : {
        "typesUsed" : {
            "Subscriber" : "http://example.com/csp_a/response#/$defs/extendedSubscriberRecord",
            "Person" : "http://etsi.org/temp/705/entities/$defs/PersonDetails"
        }
    },
    "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
Loading