{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/theholisticcare/json-schema/theholisticcare-citation-detail-response-schema.json",
  "title": "CitationDetailResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/theholisticcare-whitepapers-api-openapi.yml#/components/schemas/CitationDetailResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/CitationDetail"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    }
  },
  "$defs": {
    "Citation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Deterministic public ID in the form \"research:<slug>\". Never the raw Sanity `_id`."
        },
        "slug": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "research_citation"
          ]
        },
        "title": {
          "type": "string"
        },
        "authors": {
          "type": "string"
        },
        "year": {
          "type": "integer"
        },
        "journal": {
          "type": "string"
        },
        "study_type": {
          "type": "string"
        },
        "sample_size": {
          "type": "string"
        },
        "topic": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "key_finding": {
          "type": "string"
        },
        "limitations": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "CitationDetail": {
      "allOf": [
        {
          "$ref": "#/$defs/Citation"
        },
        {
          "type": "object",
          "properties": {
            "related_posts": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/RelatedRef"
              }
            },
            "related_terms": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/RelatedTermRef"
              }
            }
          }
        }
      ]
    },
    "Meta": {
      "type": "object",
      "description": "Present on every successful response.",
      "properties": {
        "generated_at": {
          "type": "string",
          "format": "date-time"
        },
        "provider": {
          "type": "string"
        },
        "source": {
          "type": "string"
        }
      }
    },
    "RelatedRef": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "RelatedTermRef": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    }
  }
}