{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openwaters-io/json-schema/openwaters-io-timeline-response-schema.json",
  "title": "TimelineResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openwaters-io-openapi.json#/components/schemas/TimelineResponse",
  "type": "object",
  "properties": {
    "datum": {
      "type": "string"
    },
    "units": {
      "type": "string",
      "enum": [
        "meters",
        "feet"
      ]
    },
    "station": {
      "$ref": "#/$defs/Station"
    },
    "distance": {
      "type": "number"
    },
    "timeline": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TimelineEntry"
      }
    }
  },
  "$defs": {
    "Station": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "latitude": {
          "type": "number"
        },
        "longitude": {
          "type": "number"
        },
        "region": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "continent": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "reference",
            "subordinate"
          ]
        },
        "source": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          }
        },
        "license": {
          "$ref": "#/$defs/StationLicense"
        },
        "attribution": {
          "$ref": "#/$defs/StationAttribution"
        },
        "disclaimers": {
          "type": "string"
        },
        "distance": {
          "type": "number",
          "description": "Distance from query point in kilometers (only for proximity searches)"
        },
        "datums": {
          "type": "object",
          "properties": {
            "CD": {
              "type": "number"
            },
            "CRD_OFFSET": {
              "type": "number"
            },
            "DHQ": {
              "type": "number"
            },
            "DLQ": {
              "type": "number"
            },
            "DTL": {
              "type": "number"
            },
            "GT": {
              "type": "number"
            },
            "GUVD04": {
              "type": "number"
            },
            "HAT": {
              "type": "number"
            },
            "HWI": {
              "type": "number"
            },
            "LAT": {
              "type": "number"
            },
            "LLWLT": {
              "type": "number"
            },
            "LWI": {
              "type": "number"
            },
            "MHHW": {
              "type": "number"
            },
            "MHW": {
              "type": "number"
            },
            "MHWN": {
              "type": "number"
            },
            "MHWS": {
              "type": "number"
            },
            "MLLW": {
              "type": "number"
            },
            "MLW": {
              "type": "number"
            },
            "MLWN": {
              "type": "number"
            },
            "MLWS": {
              "type": "number"
            },
            "MN": {
              "type": "number"
            },
            "MSL": {
              "type": "number"
            },
            "MTL": {
              "type": "number"
            },
            "NAVD88": {
              "type": "number"
            },
            "NLLW": {
              "type": "number"
            },
            "NMVD03": {
              "type": "number"
            },
            "NN2000": {
              "type": "number"
            },
            "PRVD02": {
              "type": "number"
            },
            "STND": {
              "type": "number"
            },
            "TLT": {
              "type": "number"
            },
            "VIVD09": {
              "type": "number"
            }
          },
          "additionalProperties": {
            "type": "number"
          }
        },
        "harmonic_constituents": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "amplitude": {
                "type": "number"
              },
              "phase": {
                "type": "number"
              }
            }
          }
        },
        "defaultDatum": {
          "type": "string"
        },
        "offsets": {
          "type": "object",
          "properties": {
            "reference": {
              "type": "string"
            },
            "height": {
              "type": "object",
              "properties": {
                "high": {
                  "type": "number"
                },
                "low": {
                  "type": "number"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "ratio",
                    "fixed"
                  ]
                }
              }
            },
            "time": {
              "type": "object",
              "properties": {
                "high": {
                  "type": "number"
                },
                "low": {
                  "type": "number"
                }
              }
            }
          }
        }
      }
    },
    "StationAttribution": {
      "type": "string",
      "description": "The credit to display wherever the station's data is shown"
    },
    "StationLicense": {
      "type": "object",
      "description": "The license of the station's data. Hosts must honor `commercial_use: false` (CC BY-NC stations).",
      "properties": {
        "type": {
          "type": "string"
        },
        "commercial_use": {
          "type": "boolean"
        },
        "url": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "TimelineEntry": {
      "type": "object",
      "properties": {
        "time": {
          "type": "string",
          "format": "date-time"
        },
        "level": {
          "type": "number"
        }
      },
      "required": [
        "time",
        "level"
      ]
    }
  }
}