{
  "openapi": "3.1.1",
  "info": {
    "title": "Puttopia API",
    "version": "1.0.0",
    "summary": "Deterministic tools for people and AI agents.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://puttopia.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Catalog of all tools",
        "responses": {
          "200": {
            "description": "Tool list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Definition of one tool",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "puttopia-shot-simulator",
                "puttopia-hole-check",
                "fieldday-wheel-spinner"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/puttopia-shot-simulator/calculate": {
      "post": {
        "operationId": "calculatePuttopiaShotSimulator",
        "summary": "Simulate one putt on a Puttopia hole: path, bounces, portals, water and whether it drops.",
        "description": "Rolls one putt with Puttopia’s deterministic minigolf physics on a built-in hole (Candy Land, Pirate Cove, Space Station) or your own hole: friction per surface, slopes, conveyor belts, bounces off walls and bumpers, rotating windmills, moving obstacles, portals, loop-de-loops and water. Shows the path from above and where the ball stops — exactly as the game rolls it.\n\nMethodology:\n- One tile is one unit (about a metre on a real course). The ball has a radius of 0.11 tiles, the cup 0.2. The putt starts at 0.35 + power × 5.65 tiles per second in the given direction; 0° points east (+x) and angles grow clockwise in the top view, so 270° points north, away from the tee in most holes.\n- The ball is integrated with a fixed time step of 1/120 s. Each step: forces (slopes 1.3 tiles/s² downhill, conveyor belts push up to 1.7 tiles/s, the cup pulls 4.5 tiles/s² toward its centre), rolling friction per surface (green and bridges 0.9, sand 3.4, ice 0.22 tiles/s²), movement, then collisions.\n- Walls and blocks bounce with a restitution of 0.72 and a little grip along the wall; bumpers kick back with 1.12 and at least 1.2 tiles/s; windmill blades and moving obstacles bounce relative to their own speed. Portals keep the ball’s speed and direction. A loop needs the speed given on the hole (usually 2.6 tiles/s) when the ball enters it; slower balls roll back.\n- The ball drops when it is over the cup slower than 1.35 tiles/s; faster balls lip out. Water and leaving the course cost a penalty stroke and the ball goes back to where the putt started. The putt ends when the ball is still or after 40 seconds.\n- Windmills, moving blocks and rafts follow the obstacle clock; the same hole, ball position, direction, power and clock always give the same path. Sines and cosines are computed with plain arithmetic so every browser and the server agree bit for bit.\n\nA game model for Puttopia, not a physics simulation of a real golf ball, green or course.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "puttopia_shot_simulator",
        "x-owner-app": "puttopia",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PuttopiaShotSimulatorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Candy Land hole 1, straight up the middle",
                  "value": {
                    "course": "candy",
                    "hole": 1,
                    "angle": 270,
                    "power": 0.78
                  }
                },
                "example2": {
                  "summary": "Through the loop-de-loop (Candy Land 7)",
                  "value": {
                    "course": "candy",
                    "hole": 7,
                    "angle": 270,
                    "power": 0.65
                  }
                },
                "example3": {
                  "summary": "Bank shot off a bumper on your own hole",
                  "value": {
                    "course": "custom",
                    "customHole": "{\"name\":\"Bumper alley\",\"par\":3,\"theme\":\"candy\",\"tiles\":[\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\"],\"start\":[2.5,6.5],\"cup\":[2.5,1.2],\"objects\":[{\"type\":\"bumper\",\"x\":2.5,\"y\":4,\"r\":0.35}]}",
                    "angle": 260,
                    "power": 0.78
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PuttopiaShotSimulatorResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/puttopia-hole-check/calculate": {
      "post": {
        "operationId": "calculatePuttopiaHoleCheck",
        "summary": "Check a minigolf hole: playable, estimated par and how many putts a perfect caddie needs.",
        "description": "Checks a Puttopia hole — built-in or made in the hole editor — for problems (start or cup off the course, cup unreachable, portal exits in the water), estimates its par from the route length and the hazards on it, counts surfaces and obstacles, and lets the caddie play it with the real physics to prove it can be holed.\n\nMethodology:\n- Errors: the start or the cup is not on playable floor, they are closer than 1.5 tiles, a portal exit is not on playable floor, or no route leads from the start to the cup. The route search walks through floor tiles (8 directions, no corner cutting), over bridges and the water a raft covers, and takes portals and loops as short cuts.\n- Estimated par = 2, plus 1 for every 8 tiles of route beyond the first 6, plus 1 when the hole has two or more hazards (windmills, moving blocks, loops, rafts, gates, water, sand), between 2 and 6.\n- The caddie tries 72 directions × 10 power levels with the real physics for each putt and plays the one that ends nearest the cup along the route (holed first, water last). It knows the physics exactly, so it is better than any person — treat its strokes as the best case.\n\nPar is an estimate for fun play, not an official minigolf rating.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "puttopia_hole_check",
        "x-owner-app": "puttopia",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PuttopiaHoleCheckInput"
              },
              "examples": {
                "example1": {
                  "summary": "Your own hole: bumper alley",
                  "value": {
                    "course": "custom",
                    "customHole": "{\"name\":\"Bumper alley\",\"par\":3,\"theme\":\"candy\",\"tiles\":[\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\"],\"start\":[2.5,6.5],\"cup\":[2.5,1.2],\"objects\":[{\"type\":\"bumper\",\"x\":2.5,\"y\":4,\"r\":0.35}]}",
                    "caddie": true
                  }
                },
                "example2": {
                  "summary": "Pirate Cove hole 9: Whirlpool",
                  "value": {
                    "course": "pirate",
                    "hole": 9,
                    "customHole": "",
                    "caddie": true
                  }
                },
                "example3": {
                  "summary": "A broken hole: the cup sits in the water",
                  "value": {
                    "course": "custom",
                    "customHole": "{\"name\":\"Soggy\",\"tiles\":[\"ggg\",\"gwg\",\"ggg\",\"ggg\"],\"start\":[1.5,3.5],\"cup\":[1.5,1.5]}",
                    "caddie": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PuttopiaHoleCheckResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/fieldday-wheel-spinner/calculate": {
      "post": {
        "operationId": "calculateFielddayWheelSpinner",
        "summary": "Spin a wheel with weighted segments — exact odds, provable result.",
        "description": "Spin a decision wheel where each segment can have its own weight (3 × pizza, 1 × sushi). The odds are exactly weight ÷ total, the organiser can publish a SHA-256 fingerprint before the spin, and the result replays identically here.\n\nMethodology:\n- Each segment covers weight ÷ total weight of the circle, clockwise from the pointer at 12 o’clock. A uniform number u in [0, 1) picks the point 360° × u that stops under the pointer, so a segment wins with probability exactly weight ÷ total (up to the 32-bit resolution of the generator).\n- The wheel turns 4–6 whole turns plus the offset that brings that point under the pointer; the app animates exactly this rotation.\n- Fairness proof (commit-reveal): fingerprint = SHA-256 of “fieldday-party-v1|wheel|\u003csegments and settings as sorted JSON\u003e|\u003csecret\u003e”, shown before the spin. The random numbers come from SHA-256 of the secret plus the audience word chosen afterwards; the generator is sfc32.\n- With “remove each winner”, later spins use the remaining segments with their weights re-normalised.\n\nFor games and everyday decisions. Without a secret the spin is predictable. Not for regulated gambling or lotteries.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "fieldday_wheel_spinner",
        "x-owner-app": "fieldday",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FielddayWheelSpinnerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Dinner wheel: pizza three times as likely as sushi",
                  "value": {
                    "segments": [
                      {
                        "label": "Pizza",
                        "weight": 3
                      },
                      {
                        "label": "Sushi",
                        "weight": 1
                      },
                      {
                        "label": "Tacos",
                        "weight": 2
                      },
                      {
                        "label": "Curry",
                        "weight": 2
                      }
                    ],
                    "spins": 1,
                    "secret": "c41d0e9b7a2f",
                    "audienceWord": "hungry"
                  }
                },
                "example2": {
                  "summary": "Turn order for four players",
                  "value": {
                    "segments": [
                      {
                        "label": "Ana"
                      },
                      {
                        "label": "Ben"
                      },
                      {
                        "label": "Cleo"
                      },
                      {
                        "label": "Dev"
                      }
                    ],
                    "spins": 3,
                    "removeWinners": true,
                    "secret": "game-night-9e2",
                    "audienceWord": "dice"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FielddayWheelSpinnerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/workflows": {
      "get": {
        "operationId": "listWorkflows",
        "summary": "Multi-tool workflows",
        "responses": {
          "200": {
            "description": "Workflow list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PuttopiaShotSimulatorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "course": {
            "title": "Course",
            "type": "string",
            "enum": [
              "candy",
              "pirate",
              "space",
              "custom"
            ],
            "default": "candy"
          },
          "hole": {
            "title": "Hole number (1–9)",
            "type": "integer",
            "minimum": 1,
            "maximum": 9,
            "default": 1
          },
          "customHole": {
            "title": "Custom hole (JSON, only for “Custom hole”)",
            "description": "Tiles as text rows (. void, # block, g green, s sand, i ice, w water, B bridge, \u003e \u003c ^ v conveyor belts, E W N S slopes down toward east/west/north/south), start and cup as [x, y] in tiles, objects such as bumpers, windmills, portals and loops.",
            "type": "string",
            "maxLength": 20000,
            "default": ""
          },
          "x": {
            "title": "Ball x (tiles, empty = tee)",
            "type": "number",
            "minimum": 0,
            "maximum": 30
          },
          "y": {
            "title": "Ball y (tiles, empty = tee)",
            "type": "number",
            "minimum": 0,
            "maximum": 30
          },
          "angle": {
            "title": "Direction (degrees: 0 east, 90 south, 180 west, 270 north)",
            "type": "number",
            "minimum": -360,
            "maximum": 720,
            "default": 270,
            "x-unit": "°"
          },
          "power": {
            "title": "Power (0 to 1)",
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "default": 0.6
          },
          "t0": {
            "title": "Obstacle clock at the putt (ticks of 1/120 s)",
            "description": "Windmills, moving blocks and rafts depend on the time of the putt.",
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "default": 0
          }
        },
        "required": []
      },
      "PuttopiaShotSimulatorResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "hole",
              "putt",
              "holed",
              "water",
              "strokes",
              "end",
              "straightDistance",
              "routeDistance",
              "seconds",
              "ticks",
              "bounces",
              "eventCounts",
              "events",
              "path"
            ],
            "properties": {
              "hole": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "name",
                  "par",
                  "theme",
                  "width",
                  "length"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "par": {
                    "type": "integer"
                  },
                  "theme": {
                    "type": "string"
                  },
                  "width": {
                    "type": "integer"
                  },
                  "length": {
                    "type": "integer"
                  }
                }
              },
              "putt": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "x",
                  "y",
                  "angle",
                  "power",
                  "t0",
                  "speed"
                ],
                "properties": {
                  "x": {
                    "type": "number"
                  },
                  "y": {
                    "type": "number"
                  },
                  "angle": {
                    "type": "number"
                  },
                  "power": {
                    "type": "number"
                  },
                  "t0": {
                    "type": "integer"
                  },
                  "speed": {
                    "type": "number"
                  }
                }
              },
              "holed": {
                "type": "boolean"
              },
              "water": {
                "type": "boolean"
              },
              "strokes": {
                "type": "integer"
              },
              "end": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "straightDistance": {
                "type": "number"
              },
              "routeDistance": {
                "type": "number"
              },
              "seconds": {
                "type": "number"
              },
              "ticks": {
                "type": "integer"
              },
              "bounces": {
                "type": "integer"
              },
              "eventCounts": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "second",
                    "type",
                    "x",
                    "y"
                  ],
                  "properties": {
                    "second": {
                      "type": "number"
                    },
                    "type": {
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    }
                  }
                }
              },
              "path": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "PuttopiaHoleCheckInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "course": {
            "title": "Course",
            "type": "string",
            "enum": [
              "candy",
              "pirate",
              "space",
              "custom"
            ],
            "default": "candy"
          },
          "hole": {
            "title": "Hole number (1–9)",
            "type": "integer",
            "minimum": 1,
            "maximum": 9,
            "default": 1
          },
          "customHole": {
            "title": "Custom hole (JSON, only for “Custom hole”)",
            "description": "Tiles as text rows (. void, # block, g green, s sand, i ice, w water, B bridge, \u003e \u003c ^ v conveyor belts, E W N S slopes down toward east/west/north/south), start and cup as [x, y] in tiles, objects such as bumpers, windmills, portals and loops.",
            "type": "string",
            "maxLength": 20000,
            "default": "{\"name\":\"Bumper alley\",\"par\":3,\"theme\":\"candy\",\"tiles\":[\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\",\"ggggg\"],\"start\":[2.5,6.5],\"cup\":[2.5,1.2],\"objects\":[{\"type\":\"bumper\",\"x\":2.5,\"y\":4,\"r\":0.35}]}"
          },
          "caddie": {
            "title": "Let the caddie play the hole",
            "type": "boolean",
            "default": true
          }
        },
        "required": []
      },
      "PuttopiaHoleCheckResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "hole",
              "playable",
              "issues",
              "estimatedPar",
              "routeLength",
              "hazards",
              "tiles",
              "objects",
              "caddie"
            ],
            "properties": {
              "hole": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "name",
                  "par",
                  "theme",
                  "width",
                  "length"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "par": {
                    "type": "integer"
                  },
                  "theme": {
                    "type": "string"
                  },
                  "width": {
                    "type": "integer"
                  },
                  "length": {
                    "type": "integer"
                  }
                }
              },
              "playable": {
                "type": "boolean"
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "level",
                    "code",
                    "message"
                  ],
                  "properties": {
                    "level": {
                      "enum": [
                        "error",
                        "warning"
                      ]
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              },
              "estimatedPar": {
                "type": "integer"
              },
              "routeLength": {
                "type": "number"
              },
              "hazards": {
                "type": "integer"
              },
              "tiles": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "objects": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "caddie": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "strokes",
                  "holed",
                  "putts"
                ],
                "properties": {
                  "strokes": {
                    "type": "integer"
                  },
                  "holed": {
                    "type": "boolean"
                  },
                  "putts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "angle",
                        "power"
                      ],
                      "properties": {
                        "angle": {
                          "type": "number"
                        },
                        "power": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "FielddayWheelSpinnerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "segments": {
            "title": "Segments",
            "type": "array",
            "minItems": 2,
            "maxItems": 40,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "label": {
                  "title": "Segment",
                  "type": "string",
                  "maxLength": 40
                },
                "weight": {
                  "title": "Weight (default 1)",
                  "type": "number",
                  "minimum": 0.001,
                  "maximum": 1000
                }
              },
              "required": [
                "label"
              ]
            }
          },
          "spins": {
            "title": "Spins",
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 1
          },
          "removeWinners": {
            "title": "Remove each winner before the next spin",
            "type": "boolean",
            "default": true
          },
          "secret": {
            "title": "Secret (revealed after the draw)",
            "description": "The organiser’s random secret. Its fingerprint is shown before the draw; empty = derived from the entries (predictable, only for demos).",
            "type": "string",
            "maxLength": 128
          },
          "audienceWord": {
            "title": "Audience word (optional)",
            "description": "A word someone calls out after the fingerprint is shown. It changes the draw, so the organiser cannot steer it.",
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "segments"
        ]
      },
      "FielddayWheelSpinnerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "segments",
              "spins",
              "removeWinners",
              "fingerprint",
              "proof",
              "secret",
              "audienceWord",
              "secretDerived",
              "winners",
              "results"
            ],
            "properties": {
              "segments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "label",
                    "weight"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "weight": {
                      "type": "number"
                    }
                  }
                }
              },
              "spins": {
                "type": "integer"
              },
              "removeWinners": {
                "type": "boolean"
              },
              "fingerprint": {
                "type": "string"
              },
              "proof": {
                "type": "string"
              },
              "secret": {
                "type": "string"
              },
              "audienceWord": {
                "type": "string"
              },
              "secretDerived": {
                "type": "boolean"
              },
              "winners": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "spin",
                    "segments",
                    "pointerAngle",
                    "rotation",
                    "winner",
                    "chance"
                  ],
                  "properties": {
                    "spin": {
                      "type": "integer"
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "label",
                          "weight",
                          "share",
                          "start",
                          "end"
                        ],
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "weight": {
                            "type": "number"
                          },
                          "share": {
                            "type": "number"
                          },
                          "start": {
                            "type": "number"
                          },
                          "end": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "pointerAngle": {
                      "type": "number"
                    },
                    "rotation": {
                      "type": "number"
                    },
                    "winner": {
                      "type": "string"
                    },
                    "chance": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}