{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Gateway set",
    "type": "array",
    "items": {
        "title": "Gateway",
        "type": "object",
        "properties": {
            "apiVersion": {
                "enum": [
                    "v1beta1",
                    "v1.0",
                    "v1"
                ]
            },
            "kind": {
                "enum": [
                    "Gateway",
                    "gateway"
                ],
                "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": {
                    "credentials": {
                        "type": "object",
                        "properties": {
                            "username": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 30
                            },
                            "secret": {
                                "type": "string",
                                "writeOnly": true
                            }
                        },
                        "required": [
                            "username",
                            "secret"
                        ]
                    },
                    "expires": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "host": {
                        "type": "string",
                        "minLength": 1
                    },
                    "port": {
                        "type": "integer"
                    },
                    "transport": {
                        "enum": [
                            "tcp",
                            "udp"
                        ]
                    },
                    "registries": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "minItems": 1,
                        "_uniqueItems": true
                    }
                },
                "required": [
                    "host",
                    "transport"
                ]
            }
        },
        "required": [
            "apiVersion",
            "kind",
            "metadata",
            "spec"
        ]
    }
}