{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/normatia-com/json-schema/normatia-com-verify-request-schema.json",
  "title": "VerifyRequest",
  "description": "Request para verificación de cumplimiento normativo",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/normatia-com-openapi.json#/components/schemas/VerifyRequest",
  "properties": {
    "element": {
      "type": "string",
      "maxLength": 500,
      "minLength": 1,
      "title": "Element",
      "description": "Elemento constructivo o instalación a verificar (p.ej. 'fachada de ladrillo cara vista')"
    },
    "parameter": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1,
      "title": "Parameter",
      "description": "Parámetro o requisito que se comprueba (p.ej. 'transmitancia térmica')"
    },
    "value": {
      "type": "number",
      "minimum": 0.0,
      "title": "Value",
      "description": "Valor del proyecto a verificar"
    },
    "unit": {
      "type": "string",
      "maxLength": 50,
      "minLength": 1,
      "title": "Unit",
      "description": "Unidad del valor (p.ej. 'W/m²K')"
    },
    "geo_id": {
      "type": "string",
      "minLength": 1,
      "title": "Geo Id",
      "description": "Identificador geográfico del municipio"
    },
    "codes": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/CodeFilter"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Codes",
      "description": "Normativas concretas contra las que verificar. Si se omite, se usan todas las aplicables a la localización"
    },
    "context": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Context",
      "description": "Texto libre con características del proyecto relevantes para la verificación (uso, tipo de intervención, superficie, número de plantas, etc.)"
    }
  },
  "type": "object",
  "required": [
    "element",
    "parameter",
    "value",
    "unit",
    "geo_id"
  ],
  "$defs": {
    "CodeFilter": {
      "properties": {
        "slug": {
          "type": "string",
          "title": "Slug",
          "description": "Slug de la normativa (p.ej. 'cte-db-he')"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version",
          "description": "Versión concreta del documento (p.ej. '2022'). Si se omite, se usan todos los documentos activos"
        }
      },
      "type": "object",
      "required": [
        "slug"
      ],
      "title": "CodeFilter",
      "description": "Filtro de normativa por slug de colección (con versión opcional)"
    }
  }
}