{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "RevisionDocument (v0.0.3)",
  "type": "object",
  "required": [
    "id",
    "timestamp",
    "page",
    "contributor",
    "minor",
    "comment",
    "bytes",
    "sha1",
    "parent_id",
    "model",
    "format"
  ],
  "properties": {
    "id": {
      "description": "The revision identifier",
      "type": "number"
    },
    "timestamp": {
      "description": "The time that the revision was saved in YYYY-MM-DDTHH:MM:SSZ format.",
      "type": "string"
    },
    "page": {
      "description": "Metadata about the page the revision was saved to",
      "type": "object",
      "required": [
        "id",
        "namespace",
        "title",
        "redirect_title",
        "restrictions"
      ],
      "properties": {
        "id": {
          "description": "The page's identifier",
          "type": "number"
        },
        "namespace": {
          "description": "The page's current namespace identifier",
          "type": "number"
        },
        "title": {
          "description": "The page's full name (including namespace prefix)",
          "type": "string"
        },
        "redirect_title": {
          "description": "Redirected to page name.  Otherwise, null.",
          "type": [
            "string",
            "null"
          ]
        },
        "restrictions": {
          "description": "The protection restrictions applied to this page.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "contributor": {
      "description": "Metadata about the user who saved the edit.  Might be null if the contributor information was deleted.",
      "type": [
        "object",
        "null"
      ],
      "required": [
        "id",
        "user_text"
      ],
      "properties": {
        "id": {
          "description": "The users's identifier if registered",
          "type": [
            "number",
            "null"
          ]
        },
        "user_text": {
          "description": "The user's user_name if registered or the IP address if anon.",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "minor": {
      "description": "Is this a minor edit?",
      "type": "boolean"
    },
    "comment": {
      "description": "The revision summary.  Might be null if the summary was deleted.",
      "type": [
        "string",
        "null"
      ]
    },
    "text": {
      "description": "The content of the revision.  Might be null if the revision content was deleted.",
      "type": [
        "string",
        "null"
      ]
    },
    "diff": {
      "description": "A collection of operations that represent the changes made in this revision.",
      "type": "array",
      "items": {
        "description": "Operation",
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the operation",
            "enum": [
              "insert",
              "delete",
              "replace",
              "equal"
            ]
          },
          "a1": {
            "description": "A reference to a starting token index from the last revision",
            "type": "number"
          },
          "a2": {
            "description": "A reference to a ending token index from the last revision",
            "type": "number"
          },
          "b1": {
            "description": "A reference to a starting token index from the current revision",
            "type": "number"
          },
          "b2": {
            "description": "A reference to a ending token index from the current revision",
            "type": "number"
          },
          "tokens": {
            "description": "The affected tokens if the operation affects tokens."
          }
        }
      }
    },
    "bytes": {
      "description": "The size of revision content in bytes",
      "type": [
        "number",
        "null"
      ]
    },
    "sha1": {
      "description": "A sha1 hash of the revision content",
      "type": "string"
    },
    "parent_id": {
      "description": "The revision ID of the preceding revision",
      "type": [
        "number",
        "null"
      ]
    },
    "model": {
      "description": "???",
      "type": "string"
    },
    "format": {
      "description": "???",
      "type": "string"
    },
    "truncated": {
      "description": "Was the text of this RevisionDocument truncated?",
      "type": "boolean"
    }
  }
}