{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cruise-itinerary-com/json-schema/cruise-itinerary-com-cruise-schema.json",
  "title": "Cruise",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cruise-itinerary-com-openapi.json#/components/schemas/Cruise",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Slug. Permanent across weekly loads."
    },
    "title": {
      "type": "string"
    },
    "ship": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "line": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "nights": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "embark_port": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "disembark_port": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "itinerary_source": {
      "type": "string",
      "description": "`official`: the line's own published day-by-day itinerary (one sailing of this cruise, fetched within the last 30 days). `supplier`: the feed's stop list, which has no day numbers.",
      "enum": [
        "official",
        "supplier"
      ]
    },
    "stops": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "seq": {
            "type": "integer",
            "description": "Position in the itinerary, from 1. Not a day number."
          },
          "day": {
            "oneOf": [
              {
                "type": "integer",
                "description": "Day of the cruise the stop starts on, 1 = embark day. Only for `official` itineraries; null for `supplier`. Sea days are the numbers not listed."
              },
              {
                "type": "null"
              }
            ]
          },
          "port": {
            "$ref": "#/$defs/Ref"
          }
        },
        "required": [
          "seq",
          "day",
          "port"
        ],
        "additionalProperties": false
      }
    },
    "next_departure": {
      "oneOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "sailing_count": {
      "type": "integer"
    },
    "page_url": {
      "type": "string",
      "description": "Public page for this cruise on Cruiseable, the free consumer site on the same data.",
      "format": "uri"
    }
  },
  "required": [
    "id",
    "title",
    "ship",
    "line",
    "nights",
    "embark_port",
    "disembark_port",
    "itinerary_source",
    "stops",
    "next_departure",
    "sailing_count",
    "page_url"
  ],
  "additionalProperties": false,
  "$defs": {
    "Ref": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Slug."
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "additionalProperties": false
    }
  }
}