{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bizzy-fm/json-schema/bizzy-fm-station-search-schema.json",
  "title": "StationSearch",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bizzy-fm-openapi.json#/components/schemas/StationSearch",
  "type": "object",
  "properties": {
    "stations": {
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
            "description": "Station UUID from the Bizzy catalog. Never invent an ID."
          },
          "name": {
            "type": "string",
            "description": "Station name as supplied by the backend."
          },
          "location": {
            "type": "string",
            "description": "Backend location, or an empty string if unspecified."
          },
          "listen_url": {
            "type": "string",
            "format": "uri",
            "description": "Canonical Bizzy listening page to share with a person; not a raw audio stream."
          },
          "availability": {
            "type": "string",
            "enum": [
              "available",
              "unavailable",
              "unknown"
            ],
            "description": "Backend health flag, not a live playback guarantee."
          }
        },
        "required": [
          "id",
          "name",
          "location",
          "listen_url",
          "availability"
        ],
        "additionalProperties": false
      }
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Number of matches in the full backend catalog, including unavailable stations."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
    },
    "next_offset": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Next page offset, or null at the end. Catalog changes can move results between pages."
    }
  },
  "required": [
    "stations",
    "total",
    "limit",
    "offset",
    "next_offset"
  ],
  "additionalProperties": false
}