{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cruise-itinerary-com/json-schema/cruise-itinerary-com-sailing-detail-schema.json",
  "title": "SailingDetail",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cruise-itinerary-com-openapi.json#/components/schemas/SailingDetail",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Sailing id (the feed id). Sailings are the only entities with integer ids."
    },
    "cruise": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Cruise slug."
        },
        "title": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "title"
      ],
      "additionalProperties": false
    },
    "ship": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "line": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "departure_date": {
      "type": "string",
      "format": "date"
    },
    "return_date": {
      "oneOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "nights": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "embark_port": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "disembark_port": {
      "oneOf": [
        {
          "$ref": "#/$defs/Ref"
        },
        {
          "type": "null"
        }
      ]
    },
    "fares": {
      "$ref": "#/$defs/Fares"
    },
    "currency": {
      "type": "string",
      "enum": [
        "USD"
      ]
    },
    "fares_changed_on": {
      "oneOf": [
        {
          "type": "string",
          "description": "Last load on which any fare moved.",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "observed_on": {
      "oneOf": [
        {
          "type": "string",
          "description": "Load that produced these fares.",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    },
    "estimated_days": {
      "type": "integer",
      "description": "Itinerary days whose date is estimated (`day_confidence` `estimated`). 0 means every day is exact."
    },
    "page_url": {
      "type": "string",
      "description": "Public page for this sailing on Cruiseable, the free consumer site on the same data.",
      "format": "uri"
    },
    "itinerary": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ItineraryDay"
      }
    }
  },
  "required": [
    "id",
    "cruise",
    "ship",
    "line",
    "departure_date",
    "return_date",
    "nights",
    "embark_port",
    "disembark_port",
    "fares",
    "currency",
    "fares_changed_on",
    "observed_on",
    "estimated_days",
    "page_url",
    "itinerary"
  ],
  "additionalProperties": false,
  "$defs": {
    "Fares": {
      "type": "object",
      "properties": {
        "inside": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "outside": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "balcony": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "suite": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "inside",
        "outside",
        "balcony",
        "suite"
      ],
      "additionalProperties": false,
      "description": "Lowest fare in whole US dollars per cabin class. null means the cabin is not offered or is sold out; the feed does not say which."
    },
    "ItineraryDay": {
      "type": "object",
      "properties": {
        "day_offset": {
          "type": "integer",
          "description": "0 is departure day."
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "port": {
          "$ref": "#/$defs/PortPoint"
        },
        "kind": {
          "type": "string",
          "enum": [
            "embark",
            "call",
            "scenic",
            "transit",
            "sea",
            "disembark"
          ]
        },
        "day_confidence": {
          "type": "string",
          "description": "`exact`: embark and disembark days, and every day of a sailing whose cruise line publishes its day-by-day itinerary (this sailing's, or its cruise's with the same nights). `estimated`: placed from leg distances, because the feed lists stops without day numbers.",
          "enum": [
            "exact",
            "estimated"
          ]
        }
      },
      "required": [
        "day_offset",
        "date",
        "port",
        "kind",
        "day_confidence"
      ],
      "additionalProperties": false
    },
    "PortPoint": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "latitude": {
              "oneOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "longitude": {
              "oneOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "id",
            "name",
            "latitude",
            "longitude"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "Ref": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Slug."
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "additionalProperties": false
    }
  }
}