{
  "openapi": "3.1.0",
  "info": {
    "title": "Quayvane Tide Tables API",
    "version": "1.0.0",
    "summary": "Harbour metadata and illustrative high and low water tables for three UK harbours.",
    "description": "Quayvane is a small read-only API. It returns harbour metadata (coordinates, time zone, chart datum) and a table of high and low water for December 2026 for Dover, Plymouth (Devonport) and Leith. The tide tables come from a simplified two-constituent (M2, S2) model and are an illustration for developers, not navigational data. Responses are static JSON files. Send a bearer token in the Authorization header; the public sample host does not check it.",
    "contact": {
      "name": "Quayvane",
      "url": "https://quayvane.t.cohesivity.xyz"
    },
    "license": {
      "name": "CC0-1.0",
      "identifier": "CC0-1.0"
    }
  },
  "externalDocs": {
    "description": "Quayvane documentation",
    "url": "https://quayvane.t.cohesivity.xyz/docs"
  },
  "servers": [
    {
      "url": "https://quayvane.t.cohesivity.xyz/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Harbours",
      "description": "List harbours and read one harbour's metadata."
    },
    {
      "name": "Tides",
      "description": "High and low water for one harbour, December 2026."
    }
  ],
  "paths": {
    "/harbours.json": {
      "get": {
        "operationId": "listHarbours",
        "tags": [
          "Harbours"
        ],
        "summary": "List harbours",
        "description": "Returns every harbour with id, name, latitude, longitude, time zone and chart datum.",
        "responses": {
          "200": {
            "description": "Harbour list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Harbour"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/harbours/{harbourId}.json": {
      "get": {
        "operationId": "getHarbour",
        "tags": [
          "Harbours"
        ],
        "summary": "Read one harbour",
        "description": "Returns one harbour's metadata.",
        "parameters": [
          {
            "name": "harbourId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "dover",
                "plymouth",
                "leith"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Harbour",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Harbour"
                }
              }
            }
          },
          "404": {
            "description": "Unknown harbour"
          }
        }
      }
    },
    "/harbours/{harbourId}/tides.json": {
      "get": {
        "operationId": "getTides",
        "tags": [
          "Tides"
        ],
        "summary": "High and low water, December 2026",
        "description": "Returns high and low water times (UTC) and heights in metres above chart datum for 1-31 December 2026.",
        "parameters": [
          {
            "name": "harbourId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "dover",
                "plymouth",
                "leith"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tide table",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TideTable"
                }
              }
            }
          },
          "404": {
            "description": "Unknown harbour"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token in the Authorization header. Not checked on the public sample host."
      }
    },
    "schemas": {
      "Harbour": {
        "type": "object",
        "required": [
          "id",
          "name",
          "lat",
          "lon",
          "timezone"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lon": {
            "type": "number"
          },
          "timezone": {
            "type": "string"
          },
          "chartDatum": {
            "type": "string"
          }
        }
      },
      "TideEvent": {
        "type": "object",
        "required": [
          "type",
          "time",
          "heightM"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "high",
              "low"
            ]
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "heightM": {
            "type": "number"
          }
        }
      },
      "TideTable": {
        "type": "object",
        "required": [
          "harbourId",
          "events"
        ],
        "properties": {
          "harbourId": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "format": "date"
          },
          "days": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TideEvent"
            }
          }
        }
      }
    }
  }
}