{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ragjur-ai/json-schema/ragjur-ai-documento-schema.json",
  "title": "Documento",
  "description": "Metadados + fatia do texto integral de um documento. Campos ausentes na fonte são omitidos.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ragjur-ai-openapi.json#/components/schemas/Documento",
  "type": "object",
  "required": [
    "id",
    "texto",
    "texto_total_chars",
    "inicio",
    "proximo_inicio"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "tribunal": {
      "type": "string"
    },
    "fonte": {
      "type": "string"
    },
    "numero_processo": {
      "type": "string"
    },
    "classe_processual": {
      "type": "string"
    },
    "relator": {
      "type": "string"
    },
    "orgao_julgador": {
      "type": "string"
    },
    "tipo_doc": {
      "type": "string"
    },
    "data_julgamento": {
      "type": "string"
    },
    "data_publicacao": {
      "type": "string",
      "format": "date"
    },
    "numero_registro": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "url_processo": {
      "type": "string",
      "format": "uri"
    },
    "dispositivo": {
      "type": "string"
    },
    "texto_origem": {
      "type": "string",
      "enum": [
        "conteudo",
        "inteiro_teor",
        "texto_integral",
        "ementa"
      ],
      "description": "Campo de onde veio `texto`; `ementa` = íntegra indisponível no índice"
    },
    "texto_total_chars": {
      "type": "integer",
      "description": "Tamanho do texto completo (caracteres)"
    },
    "inicio": {
      "type": "integer",
      "description": "Posição do primeiro caractere de `texto`"
    },
    "proximo_inicio": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Passe como `inicio` para ler a próxima fatia; `null` = fim do texto"
    },
    "_nota": {
      "type": "string"
    },
    "texto": {
      "type": "string",
      "description": "Fatia do texto integral (até `max_chars`)"
    }
  }
}