{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/myleadtech-app/json-schema/myleadtech-app-source-out-schema.json",
  "title": "SourceOut",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/myleadtech-app-openapi.json#/components/schemas/SourceOut",
  "properties": {
    "request_id": {
      "type": "string",
      "title": "Request Id"
    },
    "contract_version": {
      "type": "string",
      "title": "Contract Version",
      "default": "ar-00/1"
    },
    "service_revision": {
      "type": "string",
      "title": "Service Revision"
    },
    "publication": {
      "$ref": "#/$defs/Publication"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "partial": {
      "type": "boolean",
      "title": "Partial",
      "default": false
    },
    "missing": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Missing"
    },
    "degraded": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Degraded"
    },
    "usage": {
      "$ref": "#/$defs/CatalogUsage"
    },
    "notice": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Notice"
    },
    "source_id": {
      "type": "string",
      "title": "Source Id"
    },
    "document_version_id": {
      "type": "string",
      "title": "Document Version Id"
    },
    "document_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Document Type"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "edition_label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Edition Label"
    },
    "applicability": {
      "type": "string",
      "enum": [
        "established",
        "family_only",
        "unestablished"
      ],
      "title": "Applicability"
    },
    "text": {
      "type": "string",
      "title": "Text"
    },
    "context": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Context"
    },
    "pages": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Pages"
    },
    "citations": {
      "items": {
        "$ref": "#/$defs/Citation"
      },
      "type": "array",
      "title": "Citations"
    }
  },
  "type": "object",
  "required": [
    "request_id",
    "service_revision",
    "publication",
    "status",
    "usage",
    "source_id",
    "document_version_id",
    "applicability",
    "text"
  ],
  "$defs": {
    "Boite": {
      "properties": {
        "x0": {
          "type": "number",
          "title": "X0"
        },
        "y0": {
          "type": "number",
          "title": "Y0"
        },
        "x1": {
          "type": "number",
          "title": "X1"
        },
        "y1": {
          "type": "number",
          "title": "Y1"
        }
      },
      "type": "object",
      "required": [
        "x0",
        "y0",
        "x1",
        "y1"
      ],
      "title": "Boite"
    },
    "CatalogUsage": {
      "properties": {
        "operation": {
          "type": "string",
          "title": "Operation"
        },
        "debited": {
          "type": "boolean",
          "title": "Debited"
        },
        "units": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Units"
        },
        "remaining": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Remaining"
        },
        "window_end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Window End"
        }
      },
      "type": "object",
      "required": [
        "operation",
        "debited"
      ],
      "title": "CatalogUsage"
    },
    "Citation": {
      "properties": {
        "citation_window_id": {
          "type": "string",
          "title": "Citation Window Id"
        },
        "page_number": {
          "type": "integer",
          "title": "Page Number"
        },
        "box": {
          "anyOf": [
            {
              "$ref": "#/$defs/Boite"
            },
            {
              "type": "null"
            }
          ]
        },
        "page_actions": {
          "$ref": "#/$defs/PageActions"
        }
      },
      "type": "object",
      "required": [
        "citation_window_id",
        "page_number",
        "page_actions"
      ],
      "title": "Citation"
    },
    "PageActions": {
      "properties": {
        "rest_path": {
          "type": "string",
          "title": "Rest Path"
        },
        "default_format": {
          "type": "string",
          "title": "Default Format",
          "default": "png"
        }
      },
      "type": "object",
      "required": [
        "rest_path"
      ],
      "title": "PageActions"
    },
    "Publication": {
      "properties": {
        "branch": {
          "type": "string",
          "title": "Branch"
        },
        "snapshot_ref": {
          "type": "string",
          "title": "Snapshot Ref"
        }
      },
      "type": "object",
      "required": [
        "branch",
        "snapshot_ref"
      ],
      "title": "Publication"
    }
  }
}