{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/digitraffic-fi/json-schema/digitraffic-fi-vessels-schema.json",
  "title": "Vessels",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/digitraffic-fi-marine-api-openapi.yml#/components/schemas/Vessels",
  "required": [
    "lastUpdated",
    "vessels"
  ],
  "type": "object",
  "properties": {
    "lastUpdated": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "vessels": {
      "type": "array",
      "items": {
        "required": [
          "activities",
          "callSign",
          "imo",
          "mmsi",
          "name",
          "plannedAssistances",
          "shortcode",
          "type"
        ],
        "type": "object",
        "properties": {
          "lastUpdated": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "mmsi": {
            "type": [
              "number",
              "null"
            ]
          },
          "activities": {
            "type": "array",
            "description": "A list of all activities related to this vessel.",
            "items": {
              "anyOf": [
                {
                  "required": [
                    "assistingVessel",
                    "endTime",
                    "publicComment",
                    "reason",
                    "startTime",
                    "type"
                  ],
                  "type": "object",
                  "properties": {
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional reason for activity"
                    },
                    "assistingVessel": {
                      "required": [
                        "imo",
                        "mmsi",
                        "name"
                      ],
                      "type": "object",
                      "properties": {
                        "mmsi": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "imo": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Vessel that is assisting"
                    },
                    "publicComment": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional publicly available specification for activity."
                    },
                    "startTime": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "type": {
                      "type": "string",
                      "description": "Current list of types (subject to change): CREWA (Actual crew change), LED (Lead), LOC (Local Icebreaking), MOVE (Move), ORDER (Order), OUT (Out of Operation), CREWP (Planned crew change), STOP (Stop), TOW (Tow), TRANS (Transfer), WAIT (Wait)\n\nActivities that affect vessels subject to icebreaker assistance:\n- WAIT: vessel is waiting for icebreaker assistance\n- STOP: vessel is waiting for other reason\n\nActivities that affect icebreakers:\n- STOP, LOC, MOVE, TRANS\n\nActivities that affect both vessel and icebreaker:\n- LED, TOW"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "required": [
                    "assistedVessel",
                    "endTime",
                    "publicComment",
                    "reason",
                    "startTime",
                    "type"
                  ],
                  "type": "object",
                  "properties": {
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional reason for activity"
                    },
                    "assistedVessel": {
                      "required": [
                        "imo",
                        "mmsi",
                        "name"
                      ],
                      "type": "object",
                      "properties": {
                        "mmsi": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "imo": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Vessel that is being assisted"
                    },
                    "publicComment": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional publicly available specification for activity."
                    },
                    "startTime": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "type": {
                      "type": "string",
                      "description": "Current list of types (subject to change): CREWA (Actual crew change), LED (Lead), LOC (Local Icebreaking), MOVE (Move), ORDER (Order), OUT (Out of Operation), CREWP (Planned crew change), STOP (Stop), TOW (Tow), TRANS (Transfer), WAIT (Wait)\n\nActivities that affect vessels subject to icebreaker assistance:\n- WAIT: vessel is waiting for icebreaker assistance\n- STOP: vessel is waiting for other reason\n\nActivities that affect icebreakers:\n- STOP, LOC, MOVE, TRANS\n\nActivities that affect both vessel and icebreaker:\n- LED, TOW"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "required": [
                    "endTime",
                    "publicComment",
                    "reason",
                    "startTime",
                    "type"
                  ],
                  "type": "object",
                  "properties": {
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional reason for activity"
                    },
                    "publicComment": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional publicly available specification for activity."
                    },
                    "startTime": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "type": {
                      "type": "string",
                      "description": "Current list of types (subject to change): CREWA (Actual crew change), LED (Lead), LOC (Local Icebreaking), MOVE (Move), ORDER (Order), OUT (Out of Operation), CREWP (Planned crew change), STOP (Stop), TOW (Tow), TRANS (Transfer), WAIT (Wait)\n\nActivities that affect vessels subject to icebreaker assistance:\n- WAIT: vessel is waiting for icebreaker assistance\n- STOP: vessel is waiting for other reason\n\nActivities that affect icebreakers:\n- STOP, LOC, MOVE, TRANS\n\nActivities that affect both vessel and icebreaker:\n- LED, TOW"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "name": {
            "type": "string"
          },
          "imo": {
            "type": [
              "number",
              "null"
            ]
          },
          "plannedAssistances": {
            "type": "array",
            "description": "Planned assistances where the vessel is either the icebreaker or the one being assisted.",
            "items": {
              "anyOf": [
                {
                  "required": [
                    "assistingVessel",
                    "endTime",
                    "queuePosition",
                    "startTime"
                  ],
                  "type": "object",
                  "properties": {
                    "queuePosition": {
                      "type": "number",
                      "description": "Order number of this assistance in the icebreaker's queue of planned assistances"
                    },
                    "assistingVessel": {
                      "required": [
                        "imo",
                        "mmsi",
                        "name"
                      ],
                      "type": "object",
                      "properties": {
                        "mmsi": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "imo": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Vessel that is assisting"
                    },
                    "startTime": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "required": [
                    "assistedVessel",
                    "endTime",
                    "queuePosition",
                    "startTime"
                  ],
                  "type": "object",
                  "properties": {
                    "queuePosition": {
                      "type": "number",
                      "description": "Order number of this assistance in the icebreaker's queue of planned assistances"
                    },
                    "assistedVessel": {
                      "required": [
                        "imo",
                        "mmsi",
                        "name"
                      ],
                      "type": "object",
                      "properties": {
                        "mmsi": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "imo": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Vessel that is being assisted"
                    },
                    "startTime": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "endTime": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "shortcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Three letter code for vessel. Not unique, but might be useful to differentiate between vessels where space is limited."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vessel type. Current list of types (subject to change): Barge, Bulk Cargo, Container Cargo, General Cargo, Icebreaker, Other vessel, Passenger Ship, Pusher, Pusher+Barge, Refridgerated Cargo, River Tonnage, Roro Cargo, Supply Ship, Tanker, Tug, Tug+Barge, Vehicle Carrier"
          },
          "callSign": {
            "type": [
              "string",
              "null"
            ],
            "description": "VHF callsign"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}