{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Domain set",
    "type": "array",
    "items": {
        "title": "Domain",
        "type": "object",
        "properties": {
            "apiVersion": {
                "enum": [
                    "v1beta1",
                    "v1.0",
                    "v1"
                ]
            },
            "kind": {
                "enum": [
                    "Domain",
                    "domain"
                ],
                "readOnly": true
            },
            "metadata": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 30
                    },
                    "createdOn": {
                        "type": "string",
                        "readOnly": true
                    },
                    "modifiedOn": {
                        "type": "string",
                        "readOnly": true
                    },
                    "ref": {
                        "type": "string",
                        "readOnly": true,
                        "minLength": 3,
                        "maxLength": 24
                    }
                },
                "required": [
                    "name"
                ]
            },
            "spec": {
                "type": "object",
                "properties": {
                    "context": {
                        "type": "object",
                        "properties": {
                            "domainUri": {
                                "type": "string",
                                "readOnly": true,
                                "minLength": 1
                            },
                            "egressPolicy": {
                                "type": "object",
                                "properties": {
                                    "rule": {
                                        "type": "string"
                                    },
                                    "numberRef": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "rule",
                                    "numberRef"
                                ]
                            },
                            "accessControlList": {
                                "type": "object",
                                "properties": {
                                    "allow": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1,
                                        "_uniqueItems": true
                                    },
                                    "deny": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1,
                                        "_uniqueItems": true
                                    }
                                }
                            }
                        },
                        "required": [
                            "domainUri"
                        ]
                    }
                },
                "required": [
                    "context"
                ]
            }
        },
        "required": [
            "apiVersion",
            "kind",
            "spec",
            "metadata"
        ]
    }
}