{
    "additionalProperties": false,
    "definitions": {
        "constraints": {
            "service": {
                "_id": "#/definitions/constraints/service",
                "anyOf": [
                    {
                        "required": [
                            "build"
                        ]
                    },
                    {
                        "required": [
                            "image"
                        ]
                    }
                ],
                "properties": {
                    "build": {
                        "required": [
                            "context"
                        ]
                    }
                }
            }
        },
        "deployment": {
            "_id": "#/definitions/deployment",
            "additionalProperties": false,
            "properties": {
                "labels": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "mode": {
                    "type": "string"
                },
                "placement": {
                    "additionalProperties": false,
                    "properties": {
                        "constraints": {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    },
                    "type": "object"
                },
                "replicas": {
                    "type": "integer"
                },
                "resources": {
                    "properties": {
                        "limits": {
                            "$ref": "#/definitions/resource"
                        },
                        "reservations": {
                            "$ref": "#/definitions/resource"
                        }
                    },
                    "type": "object"
                },
                "restart_policy": {
                    "additionalProperties": false,
                    "properties": {
                        "condition": {
                            "type": "string"
                        },
                        "delay": {
                            "format": "duration",
                            "type": "string"
                        },
                        "max_attempts": {
                            "type": "integer"
                        },
                        "window": {
                            "format": "duration",
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "update_config": {
                    "additionalProperties": false,
                    "properties": {
                        "delay": {
                            "format": "duration",
                            "type": "string"
                        },
                        "failure_action": {
                            "type": "string"
                        },
                        "max_failure_ratio": {
                            "type": "number"
                        },
                        "monitor": {
                            "format": "duration",
                            "type": "string"
                        },
                        "parallelism": {
                            "type": "integer"
                        }
                    },
                    "type": "object"
                }
            },
            "type": [
                "object",
                "null"
            ]
        },
        "healthcheck": {
            "_id": "#/definitions/healthcheck",
            "additionalProperties": false,
            "properties": {
                "disable": {
                    "type": "boolean"
                },
                "interval": {
                    "type": "string"
                },
                "retries": {
                    "type": "number"
                },
                "test": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    ]
                },
                "timeout": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "list_of_strings": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "list_or_dict": {
            "oneOf": [
                {
                    "additionalProperties": false,
                    "patternProperties": {
                        ".+": {
                            "type": [
                                "string",
                                "number",
                                "null"
                            ]
                        }
                    },
                    "type": "object"
                },
                {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                }
            ]
        },
        "network": {
            "_id": "#/definitions/network",
            "additionalProperties": false,
            "properties": {
                "driver": {
                    "type": "string"
                },
                "driver_opts": {
                    "patternProperties": {
                        "^.+$": {
                            "type": [
                                "string",
                                "number"
                            ]
                        }
                    },
                    "type": "object"
                },
                "external": {
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "type": "string"
                        }
                    },
                    "type": [
                        "boolean",
                        "object"
                    ]
                },
                "internal": {
                    "type": "boolean"
                },
                "ipam": {
                    "additionalProperties": false,
                    "properties": {
                        "config": {
                            "items": {
                                "additionalProperties": false,
                                "properties": {
                                    "subnet": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            },
                            "type": "array"
                        },
                        "driver": {
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "labels": {
                    "$ref": "#/definitions/list_or_dict"
                }
            },
            "type": [
                "object",
                "null"
            ]
        },
        "plugin": {
            "_id": "#/definitions/plugin",
            "properties": {
                "options": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "version": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "resource": {
            "_id": "#/definitions/resource",
            "additionalProperties": false,
            "properties": {
                "cpus": {
                    "type": "string"
                },
                "memory": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "secret": {
            "_id": "#/definitions/secret",
            "additionalProperties": false,
            "properties": {
                "external": {
                    "properties": {
                        "name": {
                            "type": "string"
                        }
                    },
                    "type": [
                        "boolean",
                        "object"
                    ]
                },
                "file": {
                    "type": "string"
                },
                "labels": {
                    "$ref": "#/definitions/list_or_dict"
                }
            },
            "type": "object"
        },
        "service": {
            "_id": "#/definitions/service",
            "additionalProperties": false,
            "properties": {
                "build": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "additionalProperties": false,
                            "properties": {
                                "args": {
                                    "$ref": "#/definitions/list_or_dict"
                                },
                                "cache_from": {
                                    "$ref": "#/definitions/list_of_strings"
                                },
                                "context": {
                                    "type": "string"
                                },
                                "dockerfile": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    ]
                },
                "cap_add": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "cap_drop": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "cgroup_parent": {
                    "type": "string"
                },
                "command": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    ]
                },
                "container_name": {
                    "type": "string"
                },
                "depends_on": {
                    "$ref": "#/definitions/list_of_strings"
                },
                "deploy": {
                    "$ref": "#/definitions/deployment"
                },
                "devices": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "dns": {
                    "$ref": "#/definitions/string_or_list"
                },
                "dns_search": {
                    "$ref": "#/definitions/string_or_list"
                },
                "domainname": {
                    "type": "string"
                },
                "entrypoint": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    ]
                },
                "env_file": {
                    "$ref": "#/definitions/string_or_list"
                },
                "environment": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "expose": {
                    "items": {
                        "format": "expose",
                        "type": [
                            "string",
                            "number"
                        ]
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "external_links": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "extra_hosts": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "healthcheck": {
                    "$ref": "#/definitions/healthcheck"
                },
                "hostname": {
                    "type": "string"
                },
                "image": {
                    "type": "string"
                },
                "ipc": {
                    "type": "string"
                },
                "labels": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "links": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "logging": {
                    "additionalProperties": false,
                    "properties": {
                        "driver": {
                            "type": "string"
                        },
                        "options": {
                            "patternProperties": {
                                "^.+$": {
                                    "type": [
                                        "string",
                                        "number",
                                        "null"
                                    ]
                                }
                            },
                            "type": "object"
                        }
                    },
                    "type": "object"
                },
                "mac_address": {
                    "type": "string"
                },
                "network_mode": {
                    "type": "string"
                },
                "networks": {
                    "oneOf": [
                        {
                            "$ref": "#/definitions/list_of_strings"
                        },
                        {
                            "additionalProperties": false,
                            "patternProperties": {
                                "^[a-zA-Z0-9._-]+$": {
                                    "oneOf": [
                                        {
                                            "additionalProperties": false,
                                            "properties": {
                                                "aliases": {
                                                    "$ref": "#/definitions/list_of_strings"
                                                },
                                                "ipv4_address": {
                                                    "type": "string"
                                                },
                                                "ipv6_address": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            },
                            "type": "object"
                        }
                    ]
                },
                "pid": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "ports": {
                    "items": {
                        "format": "ports",
                        "type": [
                            "string",
                            "number"
                        ]
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "privileged": {
                    "type": "boolean"
                },
                "read_only": {
                    "type": "boolean"
                },
                "restart": {
                    "type": "string"
                },
                "secrets": {
                    "items": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "properties": {
                                    "gid": {
                                        "type": "string"
                                    },
                                    "mode": {
                                        "type": "number"
                                    },
                                    "source": {
                                        "type": "string"
                                    },
                                    "target": {
                                        "type": "string"
                                    },
                                    "uid": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        ]
                    },
                    "type": "array"
                },
                "security_opt": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "shm_size": {
                    "type": [
                        "number",
                        "string"
                    ]
                },
                "stdin_open": {
                    "type": "boolean"
                },
                "stop_grace_period": {
                    "format": "duration",
                    "type": "string"
                },
                "stop_signal": {
                    "type": "string"
                },
                "sysctls": {
                    "$ref": "#/definitions/list_or_dict"
                },
                "tmpfs": {
                    "$ref": "#/definitions/string_or_list"
                },
                "tty": {
                    "type": "boolean"
                },
                "ulimits": {
                    "patternProperties": {
                        "^[a-z]+$": {
                            "oneOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "additionalProperties": false,
                                    "properties": {
                                        "hard": {
                                            "type": "integer"
                                        },
                                        "soft": {
                                            "type": "integer"
                                        }
                                    },
                                    "required": [
                                        "soft",
                                        "hard"
                                    ],
                                    "type": "object"
                                }
                            ]
                        }
                    },
                    "type": "object"
                },
                "user": {
                    "type": "string"
                },
                "userns_mode": {
                    "type": "string"
                },
                "volumes": {
                    "items": {
                        "type": "string"
                    },
                    "type": "array",
                    "_uniqueItems": true
                },
                "working_dir": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "string_or_list": {
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "$ref": "#/definitions/list_of_strings"
                }
            ]
        },
        "volume": {
            "_id": "#/definitions/volume",
            "additionalProperties": false,
            "properties": {
                "driver": {
                    "type": "string"
                },
                "driver_opts": {
                    "patternProperties": {
                        "^.+$": {
                            "type": [
                                "string",
                                "number"
                            ]
                        }
                    },
                    "type": "object"
                },
                "external": {
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "type": "string"
                        }
                    },
                    "type": [
                        "boolean",
                        "object"
                    ]
                },
                "labels": {
                    "$ref": "#/definitions/list_or_dict"
                }
            },
            "type": [
                "object",
                "null"
            ]
        }
    },
    "properties": {
        "networks": {
            "_id": "#/properties/networks",
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/network"
                }
            },
            "type": "object"
        },
        "plugins": {
            "_id": "#/properties/plugins",
            "additionalProperties": false,
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/plugin"
                }
            },
            "type": "object"
        },
        "secrets": {
            "_id": "#/properties/secrets",
            "additionalProperties": false,
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/secret"
                }
            },
            "type": "object"
        },
        "services": {
            "_id": "#/properties/services",
            "additionalProperties": false,
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/service"
                }
            },
            "type": "object"
        },
        "version": {
            "type": "string"
        },
        "volumes": {
            "_id": "#/properties/volumes",
            "additionalProperties": false,
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/volume"
                }
            },
            "type": "object"
        }
    },
    "required": [
        "version"
    ],
    "type": "object"
}