{
  "$schema":     "http://json-schema.org/draft-04/schema#",
  "title":       "Task detail",
  "description": "Detailed information about a specific task",
  "type": "object",
  "properties": {
    "metadata": {
      "description": "The contents of the <task name>.json metadata file. This will be empty if the file doesn't exist, or is empty. Otherwise it is allowed to return arbitrary keys here.",
      "type": "object",
      "properties": {},
      "required": [],
      "additionalProperties": true
    },
    "files": {
      "description": "A list of executable files associated with the requested task, and data about them. The data is intended to assist in fetching their contents from the task file-content endpoint.",
      "type": "array",
      "items": {
        "description": "A single file associated with the requested task, and data about it.",
        "type": "object",
        "properties": {
          "filename": {
            "description": "The name of the file (which should match the second part of the task name) plus its extension.",
            "type": "string"
          },
          "sha256": {
            "description": "The SHA256 of the contents of the file.",
            "type": "string"
          },
          "size_bytes": {
            "description": "The size of the file, in bytes.",
            "type": "number"
          },
          "uri": {
            "description": "Information on how to request the file contents from an OpenVox Server node. This will only provide a relative path, because clients may want to request from a compile server instead of the primary server.",
            "type": "object",
            "properties": {
              "path": {
                "description": "A relative URI for accessing the task contents. A client can form the full URI by requesting 'server:port/path?params'.",
                "type": "string"
              },
              "params": {
                "description": "A map of query params to use when requesting task contents. Required to include in the URI when making a request for task contents.",
                "type": "object",
                "properties": {
                  "environment": {
                    "description": "The environment the task is in, a required query param on request to task contents.",
                    "type": "string"
                  }
                },
                "required": ["environment"],
                "additionalProperties": true
              }
            },
            "required": ["path", "params"],
            "additionalProperties": true
          }
        },
        "required": ["metadata", "files", "code_id"],
        "additionalProperties": true
      }
    }
  }
}
