{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/feason-com/json-schema/feason-com-search-response-schema.json",
  "title": "SearchResponse",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/feason-com-openapi.yml#/components/schemas/SearchResponse",
  "type": "object",
  "required": [
    "query",
    "mode",
    "filters",
    "results",
    "retrievalMetadata",
    "page"
  ],
  "properties": {
    "query": {
      "type": "string"
    },
    "mode": {
      "enum": [
        "lexical",
        "semantic",
        "hybrid"
      ]
    },
    "filters": {
      "$ref": "#/$defs/SourceFilters"
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EvidenceItem"
      }
    },
    "retrievalMetadata": {
      "type": "object",
      "additionalProperties": true
    },
    "page": {
      "type": "object",
      "required": [
        "limit",
        "offset",
        "nextCursor"
      ],
      "properties": {
        "limit": {
          "type": "integer"
        },
        "offset": {
          "type": "integer"
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  },
  "$defs": {
    "EvidenceItem": {
      "type": "object",
      "required": [
        "passageId",
        "sourceId",
        "sourceTitle",
        "sourceType",
        "tradition",
        "canonicalReference",
        "text",
        "confidence",
        "provenance",
        "retrieval"
      ],
      "properties": {
        "passageId": {
          "type": "string"
        },
        "sourceId": {
          "type": "string"
        },
        "sourceTitle": {
          "type": "string"
        },
        "author": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceType": {
          "enum": [
            "scripture",
            "creed",
            "council",
            "patristic",
            "historical",
            "confession",
            "lexicon"
          ]
        },
        "tradition": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "canonicalReference": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "relationship": {
          "type": [
            "string",
            "null"
          ]
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "provenance": {
          "type": "object",
          "required": [
            "sourceUrl",
            "license",
            "licenseNotes",
            "verificationStatus"
          ],
          "properties": {
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "translation": {
              "type": [
                "string",
                "null"
              ]
            },
            "translator": {
              "type": [
                "string",
                "null"
              ]
            },
            "edition": {
              "type": [
                "string",
                "null"
              ]
            },
            "license": {
              "type": "string"
            },
            "licenseNotes": {
              "type": "string"
            },
            "verificationStatus": {
              "enum": [
                "unverified",
                "machine_checked",
                "curated",
                "scholarly_reviewed"
              ]
            }
          }
        },
        "retrieval": {
          "type": "object",
          "required": [
            "score",
            "matchedBy"
          ],
          "properties": {
            "score": {
              "type": "number"
            },
            "matchedBy": {
              "type": "array",
              "items": {
                "enum": [
                  "lexical",
                  "semantic",
                  "ontology"
                ]
              }
            }
          }
        }
      }
    },
    "SourceFilters": {
      "type": "object",
      "properties": {
        "sourceTypes": {
          "type": "array",
          "items": {
            "enum": [
              "scripture",
              "creed",
              "council",
              "patristic",
              "historical",
              "confession",
              "lexicon"
            ]
          }
        },
        "traditions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dateFrom": {
          "type": "integer"
        },
        "dateTo": {
          "type": "integer"
        },
        "verificationStatuses": {
          "type": "array",
          "items": {
            "enum": [
              "unverified",
              "machine_checked",
              "curated",
              "scholarly_reviewed"
            ]
          }
        }
      }
    }
  }
}