{
    "$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?://"
                }
            ]
        },
        "packageInformation": {
            "type": "object",
            "properties": {
                "packageDefinition": {
                    "$ref": "#/definitions/packageDetails"
                },
                "resourceDefinition": {
                    "$ref": "#/definitions/resource"
                }
            },
            "required": [
                "packageDefinition"
            ],
            "additionalProperties": false
        },
        "packageDetails": {
            "type": "object",
            "properties": {
                "packagingVersion": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                },
                "maintainer": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "^[^\\s]+$"
                    }
                },
                "selected": {
                    "type": "boolean"
                },
                "scm": {
                    "type": "string"
                },
                "website": {
                    "type": "string"
                },
                "framework": {
                    "type": "boolean"
                },
                "preInstallNotes": {
                    "type": "string"
                },
                "postInstallNotes": {
                    "type": "string"
                },
                "postUninstallNotes": {
                    "type": "string"
                },
                "licenses": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/license"
                    }
                }
            },
            "required": [
                "packagingVersion",
                "name",
                "version",
                "maintainer",
                "description",
                "tags"
            ],
            "additionalProperties": false
        },
        "license": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "url": {
                    "$ref": "#/definitions/url"
                }
            },
            "required": [
                "name",
                "url"
            ],
            "additionalProperties": false
        },
        "resource": {
            "additionalProperties": false,
            "type": "object",
            "properties": {
                "assets": {
                    "type": "object",
                    "properties": {
                        "uris": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        },
                        "container": {
                            "type": "object",
                            "properties": {
                                "docker": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "string"
                                    }
                                }
                            },
                            "additionalProperties": false
                        }
                    },
                    "additionalProperties": false
                },
                "images": {
                    "type": "object",
                    "properties": {
                        "icon-small": {
                            "type": "string",
                            "description": "PNG icon URL, preferably 48 by 48 pixels."
                        },
                        "icon-medium": {
                            "type": "string",
                            "description": "PNG icon URL, preferably 128 by 128 pixels."
                        },
                        "icon-large": {
                            "type": "string",
                            "description": "PNG icon URL, preferably 256 by 256 pixels."
                        },
                        "screenshots": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "description": "PNG screen URL, preferably 1024 by 1024 pixels."
                            }
                        }
                    },
                    "additionalProperties": false
                }
            }
        },
        "installation": {
            "type": "object",
            "properties": {
                "appId": {
                    "type": "string"
                },
                "packageInformation": {
                    "$ref": "#/definitions/packageInformation"
                }
            },
            "required": [
                "appId",
                "packageInformation"
            ],
            "additionalProperties": false
        }
    },
    "type": "object",
    "properties": {
        "packages": {
            "type": "array",
            "description": "The list of installed packages",
            "items": {
                "$ref": "#/definitions/installation"
            }
        }
    },
    "required": [
        "packages"
    ],
    "additionalProperties": false
}