{
    "$schema": "http://json-schema.org/schema#",
    "$id": "https://ris-live.ripe.net/schemas/v1/ris_message-UPDATE.schema.json",
    "type": "object",
    "required": ["type"],
    "examples": [
	{
	    "timestamp": 1568279796.63,
	    "peer": "192.0.2.0",
	    "peer_asn": "64496",
	    "id": "21-192-0-2-0-11188782",
	    "host": "rrc21",
	    "type": "UPDATE",
	    "path": [1, 2, 3, 4],
	    "announcements": [
		{
		    "next_hop": "192.0.2.0",
		    "prefixes": [
			"192.0.3.0/24"
		    ]
		}
	    ]
	}
    ],
    "properties": {
        "type": {
            "const": "UPDATE",
            "type": "string"
        },
        "path": {
            "description": "ASNs from the AS_PATH attribute, starting with the first upstream, possibly ending in an AS_SET",
            "examples": [
                [1, 2, 3, 4],
                [1, 2, 3, [64496, 64497]]
            ],
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "title": "ASN",
                        "type": "integer",
                        "description": "16- or 32-bit ASN"
                    },
                    {
                        "title": "AS_SET",
                        "description": "AS SET represented as an array of integers in ascending numerical order",
                        "type": "array",
                        "items": {
                            "title": "ASN",
                            "type": "integer",
                            "description": "16- or 32-bit ASN"
                        }
                    }
                ]
            }
        },
        "community": {
            "type": "array",
            "examples": [
                [[64496, 1111], [64497, 2222]]
            ],
            "items": {
                "title": "community attribute",
                "description": "COMMUNITY path attribute pairing an ASN with a community value",
                "type": "array",
                "items": [
                    {
                        "title": "ASN",
                        "type": "integer"
                    },
                    {
                        "title": "community value",
                        "type": "integer"
                    }
                ]
            }
        },
        "origin": {
            "description": "ORIGIN path attribute, if present",
            "type": "string",
            "enum": [
                "igp",
                "incomplete",
                "egp"
            ]
        },
        "med": {
            "description": "MULTI_EXIT_DISC path attribute, if present",
            "type": "integer"
        },
        "aggregator": {
            "description": "AGGREGATOR path attribute, if present",
            "type": "string",
            "examples": [
                "64496:192.0.2.0"
            ]
        },
        "announcements": {
            "type": "array",
            "examples": [
                [
                    {
                        "next_hop": "192.0.2.0",
                        "prefixes": [
                            "192.0.3.0/24",
                            "192.0.4.0/24",
                            "192.0.5.0/24"
                        ]
                    },
                    {
                        "next_hop": "2001:db8::",
                        "prefixes": [
                            "2001:db8:420::/48",
                            "2001:db8:1010::/48",               
                            "2001:db8::/32"
                        ]
                    }
                ]
            ],
            "items": {
                "title": "announcement",
                "type": "object",
                "additionalProperties": false,
                "required": ["next_hop", "prefixes"],
                "properties": {
                    "next_hop": {
                        "anyOf": [
                            {
                                "title": "IPv4 address",
                                "type": "string",
                                "format": "ipv4"
                            },
                            {
                                "title": "IPv6 address",
                                "type": "string",
                                "format": "ipv6"
                            }
                        ]
                    },
                    "prefixes": {
                        "type": "array",
                        "items": {
                            "title": "IPv4 or IPv6 CIDR prefix",
                            "type": "string"
                        }
                    }
                }
            }
        },
        "withdrawals": {
            "type": "array",
            "examples": [
                [
                    "192.0.3.0/24",
                    "192.0.4.0/24",
                    "192.0.5.0/24",
                    "2001:db8:420::/48",
                    "2001:db8:1010::/48",               
                    "2001:db8::/32"
                ]
            ],
            "items": {
                "title": "IPv4 or IPv6 CIDR prefix",
                "type": "string"
            }
        }
    },
    "title": "BGP UPDATE Message"
}
