Wikipedia / MediaWiki · JSON Structure

Mediawiki Core Rest Compare Response Structure

Comparison between two revisions.

Type: object Properties: 3
Open DataPublic APIsOpen KnowledgeEncyclopediaKnowledge GraphOpen SourceNon-Profit

CompareResponse is a JSON Structure definition published by Wikipedia / MediaWiki, describing 3 properties. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

from to diff

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/wikipedia/refs/heads/main/json-structure/mediawiki-core-rest-compare-response-structure.json",
  "name": "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": "int32",
            "description": "0 context, 1 add line, 2 delete line, 3 in-line change, 4 moved paragraph, 5 paragraph moved into place"
          },
          "lineNumber": {
            "type": "int32"
          },
          "text": {
            "type": "string"
          },
          "offset": {
            "type": "object",
            "properties": {
              "from": {
                "type": "int32"
              },
              "to": {
                "type": "int32"
              }
            }
          },
          "highlightRanges": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}