{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aisle-wedding/json-schema/aisle-wedding-guest-rsvp-schema.json",
  "title": "GuestRsvp",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aisle-wedding-rsvp-api-openapi.yml#/components/schemas/GuestRsvp",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "guest_id",
    "status",
    "stage",
    "responded_at",
    "option_id",
    "option_label",
    "answers",
    "event_responses"
  ],
  "properties": {
    "guest_id": {
      "$ref": "#/$defs/GuestId"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "attending",
        "declined",
        "maybe"
      ],
      "description": "On update, explicitly setting this status clears the previous RSVP option ID and label. Omit it to preserve the guest's selected answer."
    },
    "stage": {
      "type": [
        "string",
        "null"
      ]
    },
    "responded_at": {
      "oneOf": [
        {
          "$ref": "#/$defs/Timestamp"
        },
        {
          "type": "null"
        }
      ]
    },
    "option_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "option_label": {
      "type": [
        "string",
        "null"
      ]
    },
    "answers": {
      "type": "object",
      "additionalProperties": true
    },
    "event_responses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GuestEventResponse"
      }
    }
  },
  "$defs": {
    "EventId": {
      "type": "string",
      "pattern": "^evt_.+$"
    },
    "GuestEventResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "event_id",
        "attending",
        "option_id",
        "option_label",
        "meal_choice_id",
        "meal_notes",
        "updated_at"
      ],
      "properties": {
        "event_id": {
          "$ref": "#/$defs/EventId"
        },
        "attending": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "option_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "option_label": {
          "type": [
            "string",
            "null"
          ]
        },
        "meal_choice_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "meal_notes": {
          "type": [
            "string",
            "null"
          ]
        },
        "updated_at": {
          "$ref": "#/$defs/Timestamp"
        }
      }
    },
    "GuestId": {
      "type": "string",
      "pattern": "^gst_.+$"
    },
    "Timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "An RFC 3339 UTC timestamp with milliseconds."
    }
  }
}