{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/digitraffic-fi/json-schema/digitraffic-fi-port-location-dto-v1-schema.json",
  "title": "PortLocationDtoV1",
  "description": "Ports, port areas and berths locations.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/digitraffic-fi-port-call-v1-api-openapi.yml#/components/schemas/PortLocationDtoV1",
  "required": [
    "dataUpdatedTime",
    "ssnLocations"
  ],
  "type": "object",
  "properties": {
    "dataUpdatedTime": {
      "type": "string",
      "description": "Data last updated",
      "format": "date-time"
    },
    "ssnLocations": {
      "$ref": "#/$defs/PortFeatureCollection"
    },
    "portAreas": {
      "$ref": "#/$defs/PortAreaFeatureCollection"
    },
    "berths": {
      "$ref": "#/$defs/BerthCollection"
    }
  },
  "$defs": {
    "BerthCollection": {
      "required": [
        "dataUpdatedTime"
      ],
      "type": "object",
      "properties": {
        "berths": {
          "type": "array",
          "description": "Berths",
          "items": {
            "$ref": "#/$defs/BerthProperties"
          }
        },
        "dataUpdatedTime": {
          "type": "string",
          "description": "Data last updated time",
          "format": "date-time"
        }
      },
      "description": "Berths"
    },
    "BerthProperties": {
      "required": [
        "berthCode",
        "berthName",
        "locode",
        "portAreaCode"
      ],
      "type": "object",
      "properties": {
        "locode": {
          "type": "string",
          "description": "Maritime Mobile Service Identity"
        },
        "portAreaCode": {
          "type": "string",
          "description": "Port area code"
        },
        "berthCode": {
          "type": "string",
          "description": "Berth code"
        },
        "berthName": {
          "type": "string",
          "description": "Berth name"
        }
      },
      "description": "Berth properties"
    },
    "Point": {
      "required": [
        "coordinates",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "Point"
          ]
        },
        "coordinates": {
          "type": "array",
          "description": "An array of coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
          "items": {
            "type": "number",
            "description": "An array of coordinates. Coordinates are in WGS84 format in decimal degrees: [LONGITUDE, LATITUDE, {ALTITUDE}]. Altitude is optional and measured in meters.",
            "format": "double"
          }
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        }
      },
      "description": "GeoJSON Point Geometry object"
    },
    "PortAreaFeature": {
      "required": [
        "geometry",
        "locode",
        "portAreaCode",
        "properties"
      ],
      "type": "object",
      "properties": {
        "locode": {
          "type": "string",
          "description": "Maritime Mobile Service Identity"
        },
        "type": {
          "type": "string",
          "description": "GeoJSON object type"
        },
        "geometry": {
          "$ref": "#/$defs/Point"
        },
        "properties": {
          "$ref": "#/$defs/PortAreaProperties"
        },
        "portAreaCode": {
          "type": "string",
          "description": "Port area code"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        }
      },
      "description": "Port area GeoJSON feature"
    },
    "PortAreaFeatureCollection": {
      "required": [
        "dataUpdatedTime",
        "features"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "GeoJSON object type"
        },
        "features": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PortAreaFeature"
          }
        },
        "dataUpdatedTime": {
          "type": "string",
          "description": "Data last updated time",
          "format": "date-time"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        }
      },
      "description": "Port area GeoJSON feature collection"
    },
    "PortAreaProperties": {
      "required": [
        "locode",
        "portAreaName"
      ],
      "type": "object",
      "properties": {
        "locode": {
          "type": "string",
          "description": "Maritime Mobile Service Identity"
        },
        "portAreaName": {
          "type": "string",
          "description": "Port area name"
        }
      },
      "description": "Port area GeoJSON Properties"
    },
    "PortFeature": {
      "required": [
        "geometry",
        "locode",
        "properties"
      ],
      "type": "object",
      "properties": {
        "locode": {
          "type": "string",
          "description": "Maritime Mobile Service Identity"
        },
        "type": {
          "type": "string",
          "description": "GeoJSON object type"
        },
        "geometry": {
          "$ref": "#/$defs/Point"
        },
        "properties": {
          "$ref": "#/$defs/PortProperties"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        }
      },
      "description": "Port GeoJSON feature"
    },
    "PortFeatureCollection": {
      "required": [
        "dataUpdatedTime",
        "features"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "GeoJSON object type"
        },
        "features": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PortFeature"
          }
        },
        "dataUpdatedTime": {
          "type": "string",
          "description": "Data last updated time",
          "format": "date-time"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          }
        }
      },
      "description": "Ports GeoJSON feature collection"
    },
    "PortProperties": {
      "required": [
        "country",
        "locationName",
        "locode"
      ],
      "type": "object",
      "properties": {
        "locode": {
          "type": "string",
          "description": "Maritime Mobile Service Identity"
        },
        "locationName": {
          "type": "string",
          "description": "Location name"
        },
        "country": {
          "type": "string",
          "description": "Country"
        }
      },
      "description": "Port GeoJSON Properties"
    }
  }
}