{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dockflow-com/json-schema/dockflow-com-widget-search-result-schema.json",
  "title": "WidgetSearchResult",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dockflow-com-openapi.json#/components/schemas/WidgetSearchResult",
  "type": "object",
  "properties": {
    "references": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "carrier": {
      "type": [
        "string",
        "null"
      ]
    },
    "booking_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "bill_of_lading_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "departure": {
      "anyOf": [
        {
          "$ref": "#/$defs/WidgetLeg"
        },
        {
          "type": "null"
        }
      ]
    },
    "arrival": {
      "anyOf": [
        {
          "$ref": "#/$defs/WidgetLeg"
        },
        {
          "type": "null"
        }
      ]
    },
    "containers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WidgetContainer"
      }
    },
    "tracks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WidgetTrack"
      }
    },
    "details_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "The shipment in the entity's portal, on its blueprint's domain."
    }
  },
  "required": [
    "references",
    "carrier",
    "booking_reference",
    "bill_of_lading_reference",
    "departure",
    "arrival",
    "containers",
    "tracks",
    "details_url"
  ],
  "$defs": {
    "WidgetContainer": {
      "type": "object",
      "properties": {
        "reference": {
          "type": "string"
        },
        "type_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "type_group": {
          "type": [
            "string",
            "null"
          ]
        },
        "length": {
          "type": [
            "string",
            "null"
          ]
        },
        "latest_actual_milestone": {
          "anyOf": [
            {
              "$ref": "#/$defs/WidgetMilestone"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "reference",
        "type_code",
        "type_group",
        "length",
        "latest_actual_milestone"
      ],
      "title": "WidgetContainer"
    },
    "WidgetCountry": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "iso_a2": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "iso_a2"
      ],
      "title": "WidgetCountry"
    },
    "WidgetLeg": {
      "type": "object",
      "properties": {
        "vessel_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "event_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "actual": {
          "type": "boolean"
        },
        "location": {
          "anyOf": [
            {
              "$ref": "#/$defs/WidgetLocation"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "vessel_name",
        "event_date",
        "actual",
        "location"
      ],
      "title": "WidgetLeg"
    },
    "WidgetLocation": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "unlocode": {
          "type": [
            "string",
            "null"
          ]
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "anyOf": [
            {
              "$ref": "#/$defs/WidgetCountry"
            },
            {
              "type": "null"
            }
          ]
        },
        "point": {
          "anyOf": [
            {
              "$ref": "#/$defs/WidgetPoint"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "name",
        "unlocode",
        "timezone",
        "country",
        "point"
      ],
      "title": "WidgetLocation"
    },
    "WidgetMilestone": {
      "type": "object",
      "properties": {
        "status": {
          "type": [
            "string",
            "null"
          ]
        },
        "event_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "vessel_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "location": {
          "anyOf": [
            {
              "$ref": "#/$defs/WidgetLocation"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "status",
        "event_date",
        "vessel_name",
        "location"
      ],
      "title": "WidgetMilestone"
    },
    "WidgetPoint": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "lng": {
          "type": "number"
        }
      },
      "required": [
        "lat",
        "lng"
      ],
      "title": "WidgetPoint"
    },
    "WidgetTrack": {
      "type": "object",
      "properties": {
        "device_reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "readings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WidgetTrackReading"
          }
        }
      },
      "required": [
        "device_reference",
        "readings"
      ],
      "title": "WidgetTrack"
    },
    "WidgetTrackReading": {
      "type": "object",
      "properties": {
        "event_date": {
          "type": "string"
        },
        "lat": {
          "type": "number"
        },
        "lng": {
          "type": "number"
        }
      },
      "required": [
        "event_date",
        "lat",
        "lng"
      ],
      "title": "WidgetTrackReading"
    }
  }
}