{
    "additionalProperties": false,
    "definitions": {
        "constraints": {
            "service": {
                "anyOf": [
                    {
                        "required": [
                            "build"
                        ]
                    },
                    {
                        "required": [
                            "image"
                        ]
                    }
                ],
                "id": "#/definitions/constraints/service",
                "properties": {
                    "build": {
                        "required": [
                            "context"
                        ]
                    }
                }
            }
        },
        "deployment": {
            "additionalProperties": false,
            "id": "#/definitions/deployment",
            "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": {
            "additionalProperties": false,
            "id": "#/definitions/healthcheck",
            "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": {
            "additionalProperties": false,
            "id": "#/definitions/network",
            "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": {
            "additionalProperties": false,
            "id": "#/definitions/resource",
            "properties": {
                "cpus": {
                    "type": "string"
                },
                "memory": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "service": {
            "additionalProperties": false,
            "id": "#/definitions/service",
            "properties": {
                "build": {
                    "oneOf": [
                        {
                            "type": "string"
                        },
                        {
                            "additionalProperties": false,
                            "properties": {
                                "args": {
                                    "$ref": "#/definitions/list_or_dict"
                                },
                                "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"
                },
                "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": {
            "additionalProperties": false,
            "id": "#/definitions/volume",
            "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": {
            "additionalProperties": false,
            "id": "#/properties/plugins",
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/plugin"
                }
            },
            "type": "object"
        },
        "services": {
            "additionalProperties": false,
            "id": "#/properties/services",
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/service"
                }
            },
            "type": "object"
        },
        "version": {
            "type": "string"
        },
        "volumes": {
            "additionalProperties": false,
            "id": "#/properties/volumes",
            "patternProperties": {
                "^[a-zA-Z0-9._-]+$": {
                    "$ref": "#/definitions/volume"
                }
            },
            "type": "object"
        }
    },
    "required": [
        "version"
    ],
    "type": "object"
}