{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getcaute.com/card-format/1/questions.schema.json",
  "title": "questions.json",
  "description": "Questions the person asked Caute, each answer cut to the cards in the export (ADR 0113).",
  "$defs": {
    "datetime": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}[ T]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([+-]\\d{2}:\\d{2}|Z)$",
      "description": "A date and time with its offset (RFC 3339), written with a space between date and time: 2026-10-14 03:04:05.123456+00:00. Fractional seconds are left out when they are zero."
    },
    "uuid": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    }
  },
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "question",
      "asked_at",
      "answer",
      "cites",
      "note_id"
    ],
    "additionalProperties": false,
    "properties": {
      "question": {
        "type": "string"
      },
      "asked_at": {
        "$ref": "#/$defs/datetime"
      },
      "answer": {
        "anyOf": [
          {
            "type": "string",
            "description": "The answer, with only the sentences whose sources are in the export."
          },
          {
            "type": "null"
          }
        ]
      },
      "cites": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/uuid"
        },
        "description": "The cards the answer cites, in the order its numbers refer to."
      },
      "note_id": {
        "anyOf": [
          {
            "$ref": "#/$defs/uuid"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  }
}
