openapi: 3.0.3
info:
  title: CockpitOS — Public Wayfinding / Centerplan (read-only)
  description: |
    Snapshot for codegen / Swagger UI. Canonical prose: Docusaurus *Public Center-Website API Vertrag* (Hybrid-Centerplan section).

    These routes require **no API key**. CORS is enabled for anonymous browser callers where implemented in Dashboard (`mergePublicReadCorsHeaders`).

    **Hybrid plans:** Response `floors[].mapSvg` remains a single SVG string; raster background is typically referenced via `<image href="…" />`. Optional `shopViewBoxes` JSON string may be attached per floor. See Vertrag subsection *Hybrid-Centerplan (Raster im SVG)*.
  version: 1.0.0
servers:
  - url: https://dashboard.cockpit-os.de
    description: Production dashboard
  - url: http://localhost:3000
    description: Local dashboard dev

tags:
  - name: WayfindingPublic
    description: Public read endpoints (centerId required)

paths:
  /api/wayfinding/floors:
    get:
      tags: [WayfindingPublic]
      summary: Active floors with mapSvg, mapLocations, optional shopSvgIdsWithOffers
      parameters:
        - in: query
          name: centerId
          required: true
          schema:
            type: string
            format: uuid
          description: ShoppingCenter.id from GET /api/centers/by-slug/{slug}; **not** MapFloor.id from dashboard centerplan edit URL.
        - in: query
          name: omitMapSvg
          required: false
          schema:
            type: boolean
          description: |
            If true, omits `mapSvg` body per floor; adds `hasMapSvg`, `mapSvgChars`, `suggestsHybridSvg`, `mapSvgOmitted`.
            Use for MCP/v0 inventory before fetching heavy SVG per floor.
        - in: query
          name: floorNumber
          required: false
          schema:
            type: integer
          description: Return only one floor (0=ground, 1=first upper, …).
      responses:
        '200':
          description: |
            `{ success: true, floors: Floor[] }` — each Floor may include heavy `mapSvg` text plus `mapLocations[]`, optional `shopSvgIdsWithOffers`, `mapImage`, `shopViewBoxes`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  floors:
                    type: array
                    items:
                      type: object
                      additionalProperties: true

  /api/wayfinding/centerplan:
    get:
      tags: [WayfindingPublic]
      summary: Centerplan nesting (may 404 if none)
      parameters:
        - in: query
          name: centerId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: JSON structure per dashboard route implementation
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: No centerplan record
