{
    "id": "http://schemas.taskcluster.net/base/v1/api-reference.json#",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "API Reference File",
    "description": "Reference of methods implemented by API",
    "type": "object",
    "properties": {
        "version": {
            "description": "API reference version",
            "enum": [
                0,
                "0.2.0"
            ]
        },
        "$schema": {
            "description": "Link to schema for this reference. That is a link to this very document. Typically used to identify what kind of reference this file is.",
            "title": "Schema Reference",
            "type": "string",
            "_format": "uri"
        },
        "title": {
            "description": "API title in markdown",
            "type": "string"
        },
        "description": {
            "description": "API description in markdown",
            "type": "string"
        },
        "baseUrl": {
            "description": "BaseUrl for all _routes_ described in this document",
            "type": "string",
            "_format": "uri"
        },
        "entries": {
            "type": "array",
            "title": "Entries",
            "description": "Array of methods in this reference",
            "items": {
                "type": "object",
                "properties": {
                    "type": {
                        "description": "Type of entry, currently only `function`.",
                        "type": "string",
                        "enum": [
                            "function"
                        ]
                    },
                    "method": {
                        "description": "HTTP method (verb) used to access the function",
                        "type": "string",
                        "enum": [
                            "get",
                            "post",
                            "put",
                            "head",
                            "delete",
                            "options",
                            "trace",
                            "copy",
                            "lock",
                            "mkcol",
                            "move",
                            "purge",
                            "propfind",
                            "proppatch",
                            "unlock",
                            "report",
                            "mkactivity",
                            "checkout",
                            "merge",
                            "m-search",
                            "notify",
                            "subscribe",
                            "unsubscribe",
                            "patch",
                            "search"
                        ]
                    },
                    "route": {
                        "type": "string",
                        "description": "Route for the call, note that arguments wrapped with brackets, like `/v1/user/<userId>/` must be replaced. And the route must be appended to the `baseUrl`"
                    },
                    "args": {
                        "type": "array",
                        "description": "Arguments from `route` that must be replaced, they'll appear wrapped in brackets inside `route`.",
                        "items": {
                            "type": "string",
                            "description": "Argument that appears in `route` warpped in angle brackets. It must be replaced to call the function."
                        }
                    },
                    "name": {
                        "type": "string",
                        "description": "Name of the `function` this is a stable identifier for use in auto-generated client libraries"
                    },
                    "stability": {
                        "title": "Stability-Level",
                        "description": "Stability level of the API",
                        "type": "string",
                        "enum": [
                            "deprecated",
                            "experimental",
                            "stable"
                        ]
                    },
                    "scopes": {
                        "type": "array",
                        "description": "List of scope-sets of which the client must satisfy at least one of the sets of scopes. Not provided if authentication isn't required.",
                        "items": {
                            "type": "array",
                            "description": "A set of scopes that grants access if all the scopes in the set is satisfied.  Scopes must be composed of printable ASCII characters and spaces.",
                            "items": {
                                "type": "string",
                                "description": "Scope identifier",
                                "pattern": "^[\\x20-\\x7e]*"
                            }
                        }
                    },
                    "input": {
                        "type": "string",
                        "_format": "uri",
                        "description": "JSON schema for input, if input is taken otherwise not present."
                    },
                    "output": {
                        "type": "string",
                        "_format": "uri",
                        "description": "JSON schema for output, if output is provided otherwise not present."
                    },
                    "title": {
                        "type": "string",
                        "description": "Title of API entry"
                    },
                    "description": {
                        "type": "string",
                        "description": "Description (ie. documentation) for the API entry"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "type",
                    "method",
                    "route",
                    "args",
                    "name",
                    "stability",
                    "title",
                    "description"
                ]
            }
        }
    },
    "additionalProperties": false,
    "required": [
        "version",
        "$schema",
        "title",
        "description",
        "baseUrl",
        "entries"
    ]
}