{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lenius-app/json-schema/lenius-app-discover-response-schema.json",
  "title": "DiscoverResponse",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lenius-app-openapi.json#/components/schemas/DiscoverResponse",
  "type": "object",
  "required": [
    "categories",
    "storeCategories",
    "stores"
  ],
  "properties": {
    "totalCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Ved limit: alle matchende butikker, uafhængigt af cursor."
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Ved limit: cursor til næste side, null ved sidste side."
    },
    "categories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TopCategory"
      }
    },
    "storeCategories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StoreCategory"
      }
    },
    "stores": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DiscoverStore"
      }
    }
  },
  "$defs": {
    "DiscoverStore": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "name",
        "category",
        "description",
        "storeCategoryGroup",
        "latitude",
        "longitude",
        "partnerStore",
        "distanceMeters",
        "isOpen",
        "storeCategories"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "storeCategoryGroup": {
          "$ref": "#/$defs/StoreCategoryGroup",
          "nullable": true
        },
        "teaser": {
          "type": [
            "string",
            "null"
          ]
        },
        "imageUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "imageVariants": {
          "$ref": "#/$defs/StoreImageVariants",
          "nullable": true
        },
        "logoUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "logoVariants": {
          "$ref": "#/$defs/StoreImageVariants",
          "nullable": true
        },
        "latitude": {
          "type": "number",
          "format": "double"
        },
        "longitude": {
          "type": "number",
          "format": "double"
        },
        "rating": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "partnerStore": {
          "type": "boolean"
        },
        "distanceMeters": {
          "type": "integer"
        },
        "isOpen": {
          "type": "boolean"
        },
        "storeCategories": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StoreCategoryReference"
          }
        }
      }
    },
    "StoreCategory": {
      "type": "object",
      "required": [
        "id",
        "name",
        "description",
        "symbol",
        "backgroundColor"
      ],
      "properties": {
        "storeCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Ved pagineret discover: alle matchende butikker i gruppen, før cursor/limit."
        },
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        },
        "backgroundColor": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$"
        }
      }
    },
    "StoreCategoryGroup": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "StoreCategoryReference": {
      "type": "object",
      "required": [
        "id",
        "name",
        "backgroundColor"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "backgroundColor": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$"
        }
      }
    },
    "StoreImageVariants": {
      "type": "object",
      "required": [
        "mobile",
        "desktop"
      ],
      "properties": {
        "mobile": {
          "type": "string",
          "format": "uri",
          "description": "URL til mobilvariant"
        },
        "desktop": {
          "type": "string",
          "format": "uri",
          "description": "URL til desktopvariant"
        }
      }
    },
    "TopCategory": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}