{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/corpusiuris-mx/json-schema/corpusiuris-mx-documento-schema.json",
  "title": "Documento",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/corpusiuris-mx-openapi.yml#/components/schemas/Documento",
  "type": "object",
  "properties": {
    "tipo": {
      "type": "string"
    },
    "titulo": {
      "type": "string"
    },
    "referencia": {
      "type": "string"
    },
    "texto": {
      "type": "string",
      "description": "Texto íntegro."
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "vigencia": {
      "$ref": "#/$defs/Vigencia"
    },
    "fuerza": {
      "$ref": "#/$defs/Fuerza"
    },
    "metadata": {
      "type": "object"
    }
  },
  "$defs": {
    "Fuerza": {
      "type": "object",
      "description": "En tesis y precedentes. Citar una tesis aislada como jurisprudencia obligatoria es un error grave.",
      "properties": {
        "es_jurisprudencia_obligatoria": {
          "type": "boolean"
        },
        "como_citar": {
          "type": "string"
        },
        "verificar_superacion_en": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "ficha_oficial_scjn": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    },
    "Vigencia": {
      "type": "object",
      "description": "Solo en resultados de tipo `ley`.",
      "properties": {
        "estado": {
          "type": "string",
          "enum": [
            "VIGENTE",
            "ABROGADA"
          ]
        },
        "fecha_ultima_reforma": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "verificado_al": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Fecha en que se comprobó el texto contra la fuente oficial."
        },
        "fuente_oficial": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "como_citar": {
          "type": "string"
        }
      }
    }
  }
}