Commit 6e5100a2 authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Latest changes

parent b360801c
Loading
Loading
Loading
Loading
+79 −0
Original line number Diff line number Diff line
{
  "$id": "http://example.com/csp/1.1.1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Example CSP schema demonstrating how the requirements of TS 103 705 clause 6.5.3 can be met",
  "description": "The top level of the schema is an allOf union between the ETSI Response Schema (meeting the first requirement) and a custom definition that sets out the permisslbe record types (meeting the second requirement)",
  "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": "This oneOf alternation effectively sets what the valid Record types are for this CSP schema. The previous allOf union ensures that each Record must also be a valid ETSI record as per TS 103 705 clause 5.3",
      "oneOf": [
          {
            "description" : "This means that a standard ETSI subcription record is a valid choice of record for this schema",
            "$ref": "http://etsi.org/temp/705/entities#/$defs/Subscription"
          },
          {
            "description" : "This means that a custom extended subcription record is a valid choice of record for this schema - the definition is given in the $defs section below",
            "$ref": "#/$defs/extendedSubscriberRecord"
          }
          ]
        }
    },
    "extendedSubscriberRecord": {
      "allOf" : {
          {
            "description" : "This means that a standard ETSI subcription record is a valid choice of record for this schema",
            "$ref": "http://etsi.org/temp/705/entities#/$defs/Subscription"
          },

      }
      "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
+12 −22
Original line number Diff line number Diff line
@@ -22,26 +22,22 @@
      "title": "RecordSetDescription",
      "description": "Provides metadata about the records being delivered (see clause 5.2)",
      "properties": {
        "schemaId" : { "$ref" : "#/$defs/schemaId" },
        "resultSetId" : { "$ref" : "#/$defs/resultSetId"},
        "version" : {"$ref" : "#/defs/version"},
        "created" : {"$ref" : "http://etsi.org/temp/280#/$defs/QualifiedMicrosecondDateTime"},
        "typesUsed": { "$ref" : "#/$defs/typesUsed"}
        "queryReference" : { "type" : "#/$defs/queryReference" },
        "created" : {"$ref" : "http://etsi.org/temp/280#/$defs/QualifiedMicrosecondDateTime"}
      },
      "required": [
        "typesUsed"
        "schemaId", "resultSetId", "queryReference", "created"
      ]
    },
    "typesUsed": {
      "type": "object",
      "title": "TypesUsed",
      "description": "Mapping between type identifiers (see clause 5.3.3) and JSON schema identifiers. Described in clause 5.2.2.",
      "patternProperties": {
        "": {
          "$ref": "#/$defs/schemaReference"
        }
      }
    "schemaId": {
      "type": "string"
    },
    "schemaReference": {
    "resultSetId": {
      "type": "string"
    },    
    "queryReference": {
      "type": "string"
    },    
    "recordSet": {
@@ -61,16 +57,10 @@
          "title": "id",
          "description": "Unique identifier for the Record within the RecordSet (see clause 5.3.2).",
          "type": "string"
        },
        "type": {
          "title": "type",
          "description": "Identifier the type of the record (see clause 5.3.3). The value must match one given in the typesUsed field, which in turn must refer to a schema available to the receiver",
          "type": "string"
        }
      },
      "required": [
        "id",
        "type"
        "id"
      ]
    }
  }