{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Array of savings accounts",
    "type": "object",
    "properties": {
        "savingsAccounts": {
            "title": "Savings Accounts",
            "description": "Array of savings accounts. An empty array will never be returned. In the instance that no savings accounts exist for the supplied NINO, a MATCHING_RESOURCE_NOT_FOUND error will be returned.",
            "type": "array",
            "items": {
                "title": "UK savings account",
                "type": "object",
                "properties": {
                    "id": {
                        "title": "ID",
                        "description": "The unique identifier of the savings account. For example SAVKB2UVwUTBQGJ",
                        "type": "string",
                        "pattern": "^[A-Za-z0-9]{15}$"
                    },
                    "accountName": {
                        "title": "Account name",
                        "description": "Friendly account name. Each account name added must be unique for that National Insurance number. The account name must be between 1 and 32 characters in length. Allowed characters, including spaces are: mixed case alphanumeric characters and the characters; &'()*,-./@\u00a3",
                        "type": "string",
                        "pattern": "^[A-Za-z0-9 &'()*,-./@\u00a3]{1,32}$"
                    }
                },
                "required": [
                    "id",
                    "accountName"
                ],
                "additionalProperties": false
            }
        }
    },
    "required": [
        "savingsAccounts"
    ],
    "additionalProperties": false
}