{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/filings-tools/json-schema/filings-tools-comparison-schema.json",
  "title": "Comparison",
  "description": "The filing compared with the preceding available filing of the same form. Counts and limited samples, not a full redline.",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/filings-tools-openapi.json#/components/schemas/Comparison",
  "type": "object",
  "required": [
    "id",
    "ticker",
    "form",
    "comparable",
    "current",
    "prior",
    "counting",
    "diffRulesVersion",
    "totals",
    "furniture",
    "sections"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "ticker": {
      "type": "string"
    },
    "company": {
      "type": "string"
    },
    "form": {
      "type": "string"
    },
    "comparable": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "current": {
      "$ref": "#/$defs/FilingRef"
    },
    "prior": {
      "$ref": "#/$defs/FilingRef"
    },
    "counting": {
      "type": "string",
      "description": "What totals and counts measure."
    },
    "diffRulesVersion": {
      "type": "string",
      "description": "Which counting rules made these numbers."
    },
    "totals": {
      "$ref": "#/$defs/Counts"
    },
    "furniture": {
      "$ref": "#/$defs/Counts"
    },
    "sections": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SectionDiff"
      }
    }
  },
  "$defs": {
    "Counts": {
      "type": "object",
      "required": [
        "added",
        "removed",
        "changed",
        "unchanged"
      ],
      "properties": {
        "added": {
          "type": "integer"
        },
        "removed": {
          "type": "integer"
        },
        "changed": {
          "type": "integer"
        },
        "unchanged": {
          "type": "integer"
        }
      }
    },
    "FilingRef": {
      "type": "object",
      "required": [
        "accession",
        "filingDate",
        "url",
        "page"
      ],
      "properties": {
        "accession": {
          "type": "string"
        },
        "filingDate": {
          "type": "string",
          "format": "date"
        },
        "reportDate": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "page": {
          "type": "string",
          "description": "Path of the reader page on filings.tools."
        }
      }
    },
    "SectionDiff": {
      "type": "object",
      "required": [
        "id",
        "title",
        "added",
        "removed",
        "changed",
        "counts"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "added": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Sentences that are only in the current filing. A limited sample."
        },
        "removed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Sentences that are only in the prior filing. A limited sample."
        },
        "changed": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "before",
              "after",
              "similarity"
            ],
            "properties": {
              "before": {
                "type": "string"
              },
              "after": {
                "type": "string"
              },
              "similarity": {
                "type": "number"
              }
            }
          }
        },
        "counts": {
          "$ref": "#/$defs/Counts"
        },
        "onlyIn": {
          "type": "string",
          "enum": [
            "prior",
            "current"
          ],
          "description": "The section exists in one of the two filings only."
        },
        "furniture": {
          "type": "object",
          "description": "Repeated page headers and footers of the section, compared apart from the content.",
          "additionalProperties": true
        }
      }
    }
  }
}