{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://themachinepress.com/schemas/story-v1.schema.json"
    },
    "schema_version": {
      "type": "string",
      "const": "1.0.0"
    },
    "document_type": {
      "type": "string",
      "const": "machine_press_story"
    },
    "story": {
      "type": "object",
      "properties": {
        "story_id": {
          "$ref": "#/$defs/__schema0"
        },
        "source_story_id": {
          "$ref": "#/$defs/__schema0"
        },
        "edition_id": {
          "$ref": "#/$defs/__schema0"
        },
        "edition_url": {
          "$ref": "#/$defs/__schema1"
        },
        "position": {
          "$ref": "#/$defs/__schema2"
        },
        "story_type": {
          "$ref": "#/$defs/__schema3"
        },
        "section": {
          "$ref": "#/$defs/__schema0"
        },
        "editorial_classification": {
          "$ref": "#/$defs/__schema4"
        },
        "headline": {
          "$ref": "#/$defs/__schema0"
        },
        "slug": {
          "$ref": "#/$defs/__schema0"
        },
        "dek": {
          "$ref": "#/$defs/__schema0"
        },
        "summary": {
          "$ref": "#/$defs/__schema0"
        },
        "body_text": {
          "$ref": "#/$defs/__schema0"
        },
        "why_it_matters": {
          "$ref": "#/$defs/__schema0"
        },
        "limitations": {
          "$ref": "#/$defs/__schema5"
        },
        "importance": {
          "$ref": "#/$defs/__schema6"
        },
        "canonical_url": {
          "$ref": "#/$defs/__schema1"
        },
        "json_url": {
          "$ref": "#/$defs/__schema1"
        },
        "first_published_at": {
          "$ref": "#/$defs/__schema7"
        },
        "modified_at": {
          "$ref": "#/$defs/__schema7"
        },
        "content_status": {
          "$ref": "#/$defs/__schema8"
        },
        "is_carryover": {
          "$ref": "#/$defs/__schema9"
        },
        "carryover_reason": {
          "$ref": "#/$defs/__schema10"
        },
        "key_claims": {
          "$ref": "#/$defs/__schema11"
        },
        "source_ids": {
          "$ref": "#/$defs/__schema12"
        },
        "tags": {
          "$ref": "#/$defs/__schema13"
        },
        "image_url": {
          "$ref": "#/$defs/__schema14"
        },
        "corrections": {
          "$ref": "#/$defs/__schema15"
        }
      },
      "required": [
        "story_id",
        "source_story_id",
        "edition_id",
        "edition_url",
        "position",
        "story_type",
        "section",
        "editorial_classification",
        "headline",
        "slug",
        "dek",
        "summary",
        "body_text",
        "why_it_matters",
        "limitations",
        "importance",
        "canonical_url",
        "json_url",
        "first_published_at",
        "modified_at",
        "content_status",
        "is_carryover",
        "carryover_reason",
        "key_claims",
        "source_ids",
        "tags",
        "image_url",
        "corrections"
      ],
      "additionalProperties": false
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source_id": {
            "$ref": "#/$defs/__schema0"
          },
          "title": {
            "$ref": "#/$defs/__schema0"
          },
          "publisher": {
            "$ref": "#/$defs/__schema0"
          },
          "url": {
            "$ref": "#/$defs/__schema1"
          },
          "canonical_url": {
            "$ref": "#/$defs/__schema1"
          },
          "source_type": {
            "type": "string",
            "enum": [
              "primary_research",
              "official_announcement",
              "official_documentation",
              "regulatory_filing",
              "company_statement",
              "wire_report",
              "secondary_reporting",
              "press_release",
              "aggregator",
              "repository",
              "dataset"
            ]
          },
          "is_primary_source": {
            "type": "boolean"
          },
          "published_at": {
            "anyOf": [
              {
                "$ref": "#/$defs/__schema7"
              },
              {
                "type": "null"
              }
            ]
          },
          "accessed_at": {
            "$ref": "#/$defs/__schema7"
          },
          "supports_claim_ids": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/__schema0"
            }
          }
        },
        "required": [
          "source_id",
          "title",
          "publisher",
          "url",
          "canonical_url",
          "source_type",
          "is_primary_source",
          "published_at",
          "accessed_at",
          "supports_claim_ids"
        ],
        "additionalProperties": false
      }
    },
    "corrections": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema16"
      }
    },
    "publisher": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "const": "The Machine Press"
        },
        "url": {
          "type": "string",
          "const": "https://themachinepress.com"
        },
        "description": {
          "$ref": "#/$defs/__schema0"
        }
      },
      "required": [
        "name",
        "url",
        "description"
      ],
      "additionalProperties": false
    },
    "cite_this_report": {
      "type": "object",
      "properties": {
        "title": {
          "$ref": "#/$defs/__schema0"
        },
        "publisher": {
          "type": "string",
          "const": "The Machine Press"
        },
        "published_at": {
          "$ref": "#/$defs/__schema7"
        },
        "canonical_url": {
          "$ref": "#/$defs/__schema1"
        }
      },
      "required": [
        "title",
        "publisher",
        "published_at",
        "canonical_url"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "$schema",
    "schema_version",
    "document_type",
    "story",
    "sources",
    "corrections",
    "publisher",
    "cite_this_report"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "string",
      "minLength": 1
    },
    "__schema1": {
      "type": "string",
      "format": "uri",
      "pattern": "^https:\\/\\/.*"
    },
    "__schema2": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "__schema3": {
      "type": "string",
      "enum": [
        "lead",
        "secondary",
        "ticker",
        "dispatch",
        "invention_desk"
      ]
    },
    "__schema4": {
      "type": "string",
      "enum": [
        "editorial",
        "sponsored",
        "house_example"
      ]
    },
    "__schema5": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema0"
      }
    },
    "__schema6": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema7": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "__schema8": {
      "type": "string",
      "enum": [
        "new",
        "updated",
        "carried_over"
      ]
    },
    "__schema9": {
      "type": "boolean"
    },
    "__schema10": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema11": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "claim_id": {
            "$ref": "#/$defs/__schema0"
          },
          "text": {
            "$ref": "#/$defs/__schema0"
          },
          "source_ids": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/$defs/__schema0"
            }
          },
          "qualification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "claim_id",
          "text",
          "source_ids",
          "qualification"
        ],
        "additionalProperties": false
      }
    },
    "__schema12": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema0"
      }
    },
    "__schema13": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema0"
      }
    },
    "__schema14": {
      "anyOf": [
        {
          "$ref": "#/$defs/__schema1"
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema15": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema16"
      }
    },
    "__schema16": {
      "type": "object",
      "properties": {
        "correction_id": {
          "$ref": "#/$defs/__schema0"
        },
        "revision": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "summary": {
          "$ref": "#/$defs/__schema0"
        },
        "published_at": {
          "$ref": "#/$defs/__schema7"
        },
        "affected_story_ids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "affected_claim_ids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        }
      },
      "required": [
        "correction_id",
        "revision",
        "summary",
        "published_at",
        "affected_story_ids",
        "affected_claim_ids"
      ],
      "additionalProperties": false
    }
  },
  "$id": "https://themachinepress.com/schemas/story-v1.schema.json",
  "title": "The Machine Press story document"
}
