CompareResponse

Comparison between two revisions.

Open DataPublic APIsOpen KnowledgeEncyclopediaKnowledge GraphOpen SourceNon-Profit

Properties

Name Type Description
from object
to object
diff array
View JSON Schema on GitHub

JSON Schema

mediawiki-core-rest-compare-response-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/wikipedia/refs/heads/main/json-schema/mediawiki-core-rest-compare-response-schema.json",
  "title": "CompareResponse",
  "description": "Comparison between two revisions.",
  "type": "object",
  "properties": {
    "from": {
      "$ref": "#/components/schemas/Revision"
    },
    "to": {
      "$ref": "#/components/schemas/Revision"
    },
    "diff": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "integer",
            "description": "0 context, 1 add line, 2 delete line, 3 in-line change, 4 moved paragraph, 5 paragraph moved into place"
          },
          "lineNumber": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          },
          "offset": {
            "type": "object",
            "properties": {
              "from": {
                "type": "integer"
              },
              "to": {
                "type": "integer"
              }
            }
          },
          "highlightRanges": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}