{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/contrie-com/json-schema/contrie-com-snapshot-verification-request-schema.json",
  "title": "SnapshotVerificationRequest",
  "description": "Strict supplied-snapshot contract. Total request at most 250,000 UTF-8 bytes. No account ID, parser controls, evidence candidates or model options are accepted.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/contrie-com-openapi.yml#/components/schemas/SnapshotVerificationRequest",
  "type": "object",
  "properties": {
    "source": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "maxLength": 2048,
          "description": "Descriptive HTTP(S) URL without credentials; never fetched or authenticated."
        },
        "html": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200000,
          "description": "Original supplied HTML, at most 200,000 UTF-8 bytes and valid Unicode. Markdown is not equivalent evidence."
        }
      },
      "required": [
        "url",
        "html"
      ],
      "additionalProperties": false
    },
    "contract": {
      "type": "object",
      "properties": {
        "version": {
          "const": 1
        },
        "fields": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 20,
          "propertyNames": {
            "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$",
            "not": {
              "enum": [
                "constructor",
                "prototype",
                "__proto__"
              ]
            }
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "entity": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "property": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "type": {
                "type": "string",
                "enum": [
                  "string",
                  "number",
                  "boolean"
                ]
              },
              "normalization": {
                "type": "string",
                "enum": [
                  "identity",
                  "number",
                  "boolean",
                  "period",
                  "iso-date"
                ]
              },
              "origin": {
                "type": "string",
                "enum": [
                  "any",
                  "body",
                  "jsonld",
                  "metadata",
                  "microdata",
                  "form"
                ]
              },
              "excludeDeclaredHidden": {
                "type": "boolean"
              },
              "nullable": {
                "type": "boolean"
              },
              "qualifiers": {
                "$ref": "#/$defs/VerificationQualifiers"
              }
            },
            "required": [
              "entity",
              "property",
              "type"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "version",
        "fields"
      ],
      "additionalProperties": false
    },
    "proposedData": {
      "type": "object",
      "maxProperties": 20,
      "propertyNames": {
        "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$",
        "not": {
          "enum": [
            "constructor",
            "prototype",
            "__proto__"
          ]
        }
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 4096
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ]
      },
      "description": "Optional scalar values being checked. Must contain exactly every contract field; nested values and evidence IDs are rejected. Null can be accepted only for an explicitly nullable field with matching source support."
    }
  },
  "required": [
    "source",
    "contract"
  ],
  "additionalProperties": false,
  "$defs": {
    "VerificationQualifiers": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "period": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "unit": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "variant": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "temporal": {
          "type": "string",
          "enum": [
            "current",
            "previous"
          ]
        }
      },
      "required": [],
      "additionalProperties": false
    }
  }
}