{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alfil-co/json-schema/alfil-co-partido-perfil-schema.json",
  "title": "PartidoPerfil",
  "description": "Perfil institucional del partido (sin PII)",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alfil-co-partidos-api-openapi.yml#/components/schemas/PartidoPerfil",
  "type": "object",
  "properties": {
    "slug": {
      "type": "string"
    },
    "nombre": {
      "type": "string"
    },
    "curules_vigentes": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "description": "Curules vigentes"
    },
    "bloque": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Bloque político"
    },
    "fuente": {
      "$ref": "#/$defs/Fuente"
    },
    "referencias": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Referencia"
      }
    }
  },
  "required": [
    "slug",
    "nombre",
    "curules_vigentes",
    "bloque",
    "fuente",
    "referencias"
  ],
  "additionalProperties": false,
  "$defs": {
    "Fuente": {
      "type": "object",
      "properties": {
        "nombre": {
          "type": "string",
          "description": "Fuente oficial del dato"
        },
        "url": {
          "description": "URL de la fuente oficial",
          "type": "string"
        },
        "corte": {
          "type": "string",
          "description": "Fecha de corte del dato (ISO 8601)"
        },
        "licencia": {
          "description": "Licencia de la fuente",
          "type": "string"
        }
      },
      "required": [
        "nombre",
        "corte"
      ],
      "additionalProperties": false,
      "description": "Proveniencia: fuente oficial y fecha de corte (atribución Ley 1712)"
    },
    "Referencia": {
      "type": "object",
      "properties": {
        "tipo": {
          "type": "string",
          "enum": [
            "pagina_alfil",
            "registro_oficial",
            "documento_oficial",
            "coleccion_oficial"
          ]
        },
        "titulo": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/[^/?#@]+(?:[/?#].*)?$",
          "format": "uri"
        },
        "proveedor": {
          "type": "string"
        },
        "id_externo": {
          "type": "string"
        }
      },
      "required": [
        "tipo",
        "titulo",
        "url",
        "proveedor"
      ],
      "additionalProperties": false,
      "description": "Enlace HTTPS navegable a Alfil o a una fuente oficial"
    }
  }
}