{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/compatair-fr/json-schema/compatair-fr-search-result-schema.json",
  "title": "SearchResult",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/compatair-fr-openapi.yml#/components/schemas/SearchResult",
  "allOf": [
    {
      "$ref": "#/$defs/PublicEnvelope"
    },
    {
      "type": "object",
      "required": [
        "items"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KnowledgeRecord"
          }
        },
        "nextCursor": {
          "type": "string"
        }
      }
    }
  ],
  "$defs": {
    "KnowledgeRecord": {
      "type": "object",
      "required": [
        "id",
        "type",
        "locale",
        "title",
        "url",
        "content_sha256"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "enum": [
            "Guide",
            "Glossaire",
            "Compresseur",
            "Outil"
          ]
        },
        "locale": {
          "enum": [
            "fr",
            "en"
          ]
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "excerpt": {
          "type": "string",
          "maxLength": 1200
        },
        "content_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "additionalProperties": true
    },
    "PublicEnvelope": {
      "type": "object",
      "required": [
        "verdict",
        "verdict_scope",
        "verdict_schema_version",
        "canonical_url",
        "product_urls",
        "source_urls",
        "method_version",
        "catalog_version",
        "observed_at",
        "limitations",
        "next_actions"
      ],
      "properties": {
        "verdict": {
          "enum": [
            "information",
            "compatible",
            "compatible_with_limits",
            "incompatible",
            "insufficient_data"
          ]
        },
        "verdict_scope": {
          "enum": [
            "information",
            "request",
            "air_supply",
            "complete_air_system",
            "commercial_constraints"
          ]
        },
        "verdict_schema_version": {
          "const": "2.0.0"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://compatair\\.fr/"
        },
        "product_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://compatair\\.fr/"
          },
          "uniqueItems": true
        },
        "source_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          },
          "uniqueItems": true
        },
        "method_version": {
          "type": "string",
          "pattern": "^2026\\.[0-9]{2}$"
        },
        "catalog_version": {
          "type": "string",
          "minLength": 1
        },
        "observed_at": {
          "type": "string",
          "format": "date"
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}