{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "dcosReleaseVersion": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.(?:0|[1-9][0-9]*))*$",
            "description": "A string representation of a DC/OS Release Version"
        },
        "url": {
            "type": "string",
            "allOf": [
                {
                    "format": "uri"
                },
                {
                    "pattern": "^https?://"
                }
            ]
        },
        "v20Package": {
            "properties": {
                "packagingVersion": {
                    "type": "string",
                    "enum": [
                        "2.0"
                    ]
                },
                "name": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                },
                "scm": {
                    "type": "string"
                },
                "maintainer": {
                    "type": "string"
                },
                "website": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "framework": {
                    "type": "boolean",
                    "default": false,
                    "description": "True if this package installs a new Mesos framework."
                },
                "preInstallNotes": {
                    "type": "string",
                    "description": "Pre installation notes that would be useful to the user of this package."
                },
                "postInstallNotes": {
                    "type": "string",
                    "description": "Post installation notes that would be useful to the user of this package."
                },
                "postUninstallNotes": {
                    "type": "string",
                    "description": "Post uninstallation notes that would be useful to the user of this package."
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "^[^\\s]+$"
                    }
                },
                "selected": {
                    "type": "boolean",
                    "description": "Flag indicating if the package is selected in search results",
                    "default": false
                },
                "licenses": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "description": "The name of the license. For example one of [Apache License Version 2.0 | MIT License | BSD License | Proprietary]"
                            },
                            "url": {
                                "$ref": "#/definitions/url",
                                "description": "The URL where the license can be accessed"
                            }
                        },
                        "additionalProperties": false,
                        "required": [
                            "name",
                            "url"
                        ]
                    }
                }
            },
            "required": [
                "packagingVersion",
                "name",
                "version",
                "maintainer",
                "description",
                "tags"
            ],
            "additionalProperties": false
        },
        "v30Package": {
            "properties": {
                "packagingVersion": {
                    "type": "string",
                    "enum": [
                        "3.0"
                    ]
                },
                "name": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                },
                "scm": {
                    "type": "string"
                },
                "maintainer": {
                    "type": "string"
                },
                "website": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "framework": {
                    "type": "boolean",
                    "default": false,
                    "description": "True if this package installs a new Mesos framework."
                },
                "preInstallNotes": {
                    "type": "string",
                    "description": "Pre installation notes that would be useful to the user of this package."
                },
                "postInstallNotes": {
                    "type": "string",
                    "description": "Post installation notes that would be useful to the user of this package."
                },
                "postUninstallNotes": {
                    "type": "string",
                    "description": "Post uninstallation notes that would be useful to the user of this package."
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "^[^\\s]+$"
                    }
                },
                "selected": {
                    "type": "boolean",
                    "description": "Flag indicating if the package is selected in search results",
                    "default": false
                },
                "licenses": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "description": "The name of the license. For example one of [Apache License Version 2.0 | MIT License | BSD License | Proprietary]"
                            },
                            "url": {
                                "$ref": "#/definitions/url",
                                "description": "The URL where the license can be accessed"
                            }
                        },
                        "additionalProperties": false,
                        "required": [
                            "name",
                            "url"
                        ]
                    }
                },
                "minDcosReleaseVersion": {
                    "$ref": "#/definitions/dcosReleaseVersion",
                    "description": "The minimum DC/OS Release Version the package can run on."
                }
            },
            "required": [
                "packagingVersion",
                "name",
                "version",
                "maintainer",
                "description",
                "tags"
            ],
            "additionalProperties": false
        }
    },
    "type": "object",
    "oneOf": [
        {
            "$ref": "#/definitions/v20Package"
        },
        {
            "$ref": "#/definitions/v30Package"
        }
    ]
}