{
    "definitions": {
        "app": {
            "$schema": "http://json-schema.org/draft-04/schema",
            "definitions": {
                "file": {
                    "description": "an attachment of app",
                    "example": "",
                    "readOnly": false,
                    "type": "string"
                },
                "id": {
                    "description": "unique identifier of app",
                    "example": "01234567-89ab-cdef-0123-456789abcdef",
                    "format": "uuid",
                    "readOnly": true,
                    "type": [
                        "string"
                    ]
                },
                "name": {
                    "description": "unique name of app",
                    "example": "example",
                    "pattern": "^[a-z][a-z0-9-]{3,50}$",
                    "readOnly": false,
                    "type": [
                        "string"
                    ]
                }
            },
            "description": "An app is a program to be deployed.",
            "id": "schemata/app",
            "links": [
                {
                    "description": "Create a new app.",
                    "href": "/apps",
                    "method": "POST",
                    "rel": "create",
                    "schema": {
                        "properties": {
                            "name": {
                                "$ref": "#/definitions/app/definitions/name"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Create"
                },
                {
                    "description": "Delete an existing app.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fid)}",
                    "method": "DELETE",
                    "rel": "destroy",
                    "title": "Delete"
                },
                {
                    "description": "Info for existing app.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fid)}",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                },
                {
                    "description": "Info for existing apps in text format",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fid)}/text",
                    "mediaType": "text/plain",
                    "method": "GET",
                    "rel": "self",
                    "title": "Info"
                },
                {
                    "description": "List existing apps.",
                    "href": "/apps",
                    "method": "GET",
                    "rel": "instances",
                    "title": "List"
                },
                {
                    "description": "Update an existing app.",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fid)}",
                    "method": "PATCH",
                    "rel": "update",
                    "schema": {
                        "properties": {
                            "name": {
                                "$ref": "#/definitions/app/definitions/name"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Update"
                },
                {
                    "description": "Upload an attachment file for an app",
                    "encType": "multipart/form-data",
                    "href": "/apps/{(%23%2Fdefinitions%2Fapp%2Fdefinitions%2Fid)}/files",
                    "method": "POST",
                    "rel": "create",
                    "schema": {
                        "properties": {
                            "file": {
                                "$ref": "#/definitions/app/definitions/file"
                            }
                        },
                        "type": [
                            "object"
                        ]
                    },
                    "title": "Create"
                }
            ],
            "properties": {
                "id": {
                    "$ref": "#/definitions/app/definitions/id"
                },
                "name": {
                    "$ref": "#/definitions/app/definitions/name"
                }
            },
            "required": [
                "id"
            ],
            "title": "App",
            "type": [
                "object"
            ]
        }
    },
    "description": "A schema for a small example API.",
    "links": [
        {
            "href": "http://localhost:5000",
            "rel": "self"
        }
    ],
    "properties": {
        "app": {
            "$ref": "#/definitions/app"
        }
    },
    "title": "Example API",
    "type": [
        "object"
    ]
}