nhs-notify-standards

#

$idnhs-notify-payload.schema.json
$schemahttps://json-schema.org/draft/2020-12/schema

Properties

NameType
notify-dataAny of:Object
Object
notify-metadataObject (of type NHS Notify Metadata)

Example

{
    "notify-data": {
        "nhsNumber": "9434765919"
    },
    "notify-metadata": {
        "teamResponsible": "Team 1",
        "notifyDomain": "Ordering",
        "version": "1.3.0",
        "microservice": "order-service"
    }
}

Example

{
    "notify-data": {
        "plane": "control",
        "action": "rotate-keys"
    },
    "notify-metadata": {
        "teamResponsible": "Team 2",
        "notifyDomain": "Reporting",
        "version": "2.0.0",
        "microservice": "reporting-api"
    }
}

notify-data

Description Domain specific data attributes (variant: DataPlane | ControlPlane).
TypeAny of:Object
Object
Required Yes

notify-data.0

Description Placeholder for data-plane specific properties (extend in concrete event schemas).
TypeObject

notify-data.1

Description Placeholder for control-plane specific properties (extend in concrete event schemas).
TypeObject

notify-metadata

Defined in ./nhs-notify-metadata.schema.html

$id nhs-notify-metadata.schema.json
Title NHS Notify Metadata
Description Standard metadata set shared across Notify events.
TypeObject (of type NHS Notify Metadata)
Required Yes

Properties

NameType
teamResponsibleString
notifyDomainString
microserviceString
versionString

Schema

{
    "$id": "nhs-notify-payload.schema.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$comment": "Notify Payload",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "notify-data",
        "notify-metadata"
    ],
    "properties": {
        "notify-data": {
            "type": "object",
            "anyOf": [
                {
                    "$ref": "#/$defs/DataPlane"
                },
                {
                    "$ref": "#/$defs/ControlPlane"
                }
            ],
            "description": "Domain specific data attributes (variant: DataPlane | ControlPlane).",
            "examples": [
                {
                    "nhsNumber": "9434765919"
                },
                {
                    "plane": "control",
                    "action": "rotate-keys"
                }
            ],
            "$comment": "Union of two variant payload shapes. anyOf is used (instead of oneOf) because the two variants are currently placeholders and not mutually differentiable. Once DataPlane and ControlPlane gain distinct required properties or a discriminator, switch to oneOf (and optionally add a 'plane' enum property) to prevent ambiguous matches."
        },
        "notify-metadata": {
            "$ref": "./nhs-notify-metadata.schema.json",
            "description": "Standard metadata set shared across Notify events.",
            "examples": [
                {
                    "teamResponsible": "Team 1",
                    "notifyDomain": "Ordering",
                    "version": "1.3.0",
                    "microservice": "order-service"
                }
            ]
        }
    },
    "$defs": {
        "DataPlane": {
            "type": "object",
            "description": "Placeholder for data-plane specific properties (extend in concrete event schemas).",
            "$comment": "Add required fields here (e.g. 'plane': 'data') or domain-specific attributes; when distinct from ControlPlane, change notify-data.anyOf to oneOf to enforce exclusivity."
        },
        "ControlPlane": {
            "type": "object",
            "description": "Placeholder for control-plane specific properties (extend in concrete event schemas).",
            "$comment": "As with DataPlane, add identifying / required properties here (e.g. 'plane': 'control'). Ensure divergence for better validation and consumer code generation."
        }
    },
    "examples": [
        {
            "notify-data": {
                "nhsNumber": "9434765919"
            },
            "notify-metadata": {
                "teamResponsible": "Team 1",
                "notifyDomain": "Ordering",
                "version": "1.3.0",
                "microservice": "order-service"
            }
        },
        {
            "notify-data": {
                "plane": "control",
                "action": "rotate-keys"
            },
            "notify-metadata": {
                "teamResponsible": "Team 2",
                "notifyDomain": "Reporting",
                "version": "2.0.0",
                "microservice": "reporting-api"
            }
        }
    ]
}