{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fluvigil-de/json-schema/fluvigil-de-flood-situation-response-schema.json",
  "title": "FloodSituationResponse",
  "description": "The report (`reportDate`, `generatedAt`, `totalInFlood`, counts `byClass` and `byState`, the most affected gauges in `topStations`) and its summary text (null while none exists).",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fluvigil-de-openapi.yaml#/components/schemas/FloodSituationResponse",
  "type": "object",
  "properties": {
    "report": {
      "type": "object",
      "properties": {
        "reportDate": {
          "type": "string"
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "totalInFlood": {
          "type": "integer"
        },
        "byClass": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "lhpClass": {
                "type": "integer"
              },
              "count": {
                "type": "integer"
              }
            }
          }
        },
        "byState": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "federalState": {
                "type": "string"
              },
              "floodCount": {
                "type": "integer"
              },
              "maxClass": {
                "type": "integer"
              }
            }
          }
        },
        "topStations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "slug": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "type": "string"
              },
              "water": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "lhpClass": {
                "type": "integer"
              },
              "lhpClassName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "valueCentimeters": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Level at the time of the report; null where the gauge has no notice."
              },
              "measuredAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When that level was measured (UTC); null where the level is withheld, the gauge reported no time, or the report was stored before the time was kept."
              },
              "sourceNotice": {
                "oneOf": [
                  {
                    "$ref": "#/$defs/SourceNotice"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "summaryText": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "SourceNotice": {
      "description": "Conditions a data provider attaches to its gauges, set wherever a gauge's values are delivered. The fields of `SourceNoticePart` describe the source of the values; `parts` lists every source involved (the value source first, the station source after it where they differ), and `form` is `full-only` as soon as one part is. `sourceLine`, `rawData`, `disclaimer`, `noOfficialWarning` and `termsPath` are the older plain-text fields and stay for existing clients; the three that a provider does not demand are null.\n",
      "allOf": [
        {
          "$ref": "#/$defs/SourceNoticePart"
        },
        {
          "type": "object",
          "properties": {
            "parts": {
              "type": "array",
              "description": "The notice of every source involved, each with the fields from `id` to `textShort`.",
              "items": {
                "$ref": "#/$defs/SourceNoticePart"
              }
            },
            "sourceLine": {
              "type": "string",
              "description": "Credit line of the provider"
            },
            "rawData": {
              "type": [
                "string",
                "null"
              ],
              "description": "Notice that the values are preliminary or unchecked raw data"
            },
            "disclaimer": {
              "type": [
                "string",
                "null"
              ],
              "description": "Liability disclaimer with the pointer to the terms"
            },
            "noOfficialWarning": {
              "type": [
                "string",
                "null"
              ],
              "description": "Statement that the presentation is no official warning"
            },
            "termsPath": {
              "type": "string",
              "description": "Path of the terms page holding the full liability disclaimer"
            }
          }
        }
      ]
    },
    "SourceNoticePart": {
      "type": "object",
      "description": "The conditions of one source involved in the values a gauge shows.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Key of the source record the notice part comes from: a station source (`pegelonline`, `ch`, `lhp`, ...), a state value source (`ni-nlwkn`, `th-hnz`, ...), or `salzburg` / `niederoesterreich` for those two Austrian variants.\n"
        },
        "form": {
          "type": "string",
          "enum": [
            "short-allowed",
            "full-only"
          ],
          "description": "`full-only` when the provider approved paragraphs that must never be shortened"
        },
        "permissionBasis": {
          "type": "string",
          "enum": [
            "licence",
            "statutory-access",
            "written-consent",
            "licence-and-consent"
          ]
        },
        "licence": {
          "type": [
            "object",
            "null"
          ],
          "description": "The licence the permission rests on; null for statutory access and written consent alone.",
          "properties": {
            "name": {
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          }
        },
        "sourceName": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string"
        },
        "rightsHolder": {
          "type": "string"
        },
        "fetchedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When Fluvigil fetched the values (UTC); null where not known"
        },
        "stampedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The provider's own time stamp (\"Stand\") where its licence keeps it visible"
        },
        "stationLink": {
          "type": [
            "string",
            "null"
          ],
          "description": "Origin page of this gauge where the provider demands it"
        },
        "text": {
          "type": "string",
          "description": "The full notice as plain text"
        },
        "textShort": {
          "type": [
            "string",
            "null"
          ],
          "description": "The shortened notice; null for `full-only`"
        }
      }
    }
  }
}