{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whichli-com/json-schema/whichli-com-poll-schema.json",
  "title": "Poll",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whichli-com-openapi.yml#/components/schemas/Poll",
  "type": "object",
  "required": [
    "publicId",
    "title",
    "creatorName",
    "mode",
    "expiresAt",
    "voteUrl",
    "resultsUrl",
    "options"
  ],
  "properties": {
    "publicId": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "creatorName": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "duel",
        "swipe"
      ]
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "voteUrl": {
      "type": "string",
      "format": "uri"
    },
    "resultsUrl": {
      "type": "string",
      "format": "uri"
    },
    "options": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PollOption"
      }
    }
  },
  "$defs": {
    "PollOption": {
      "type": "object",
      "required": [
        "id",
        "caption",
        "imageUrl",
        "productUrl"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "caption": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "productUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    }
  }
}