{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://morris.golf/standards/morris-shot/v1.json",
  "title": "Morris Shot JSON v1",
  "description": "One golf shot as a launch monitor measures it, in SI units: metres, m/s, degrees, rpm and seconds. Directions, spin axis, side spin, club path and face are positive to the right of the target line. Fields this schema does not name are ignored. By Morris. Specification: https://morris.golf/game/api. License: CC BY 4.0.",
  "type": "object",
  "required": ["format", "version", "ball_speed", "launch", "launch_dir"],
  "anyOf": [{ "required": ["spin"] }, { "required": ["back_spin", "side_spin"] }],
  "properties": {
    "format": {
      "const": "morris-shot",
      "description": "Always \"morris-shot\": a message with this value is read as Morris Shot JSON."
    },
    "version": {
      "type": "string",
      "pattern": "^1\\.[0-9]+$",
      "description": "\"1.0\". Every 1.x version is read the same way: a 1.x version only adds optional fields."
    },
    "device": {
      "type": "string",
      "maxLength": 200,
      "description": "Name of the launch monitor or of the program that sends the shot."
    },
    "shot_number": {
      "type": "integer",
      "description": "The shot's counter. A shot with the same number as the previous one on the same connection is acknowledged and not played."
    },
    "time": {
      "type": "string",
      "format": "date-time",
      "description": "When the shot was hit: ISO 8601 date and time with its time zone."
    },
    "handed": {
      "enum": ["RH", "LH"],
      "description": "The player's hand: \"RH\" right-handed, \"LH\" left-handed."
    },
    "club": {
      "enum": ["DR", "3W", "5W", "3H", "4i", "5i", "6i", "7i", "8i", "9i", "PW", "GW", "SW", "LW", "PT"],
      "description": "The club, as a short code: driver, woods, hybrid, irons, wedges and putter."
    },
    "ball_speed": {
      "type": "number",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 100,
      "description": "Ball speed just after impact, m/s."
    },
    "launch": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Vertical launch angle, degrees above the horizontal."
    },
    "launch_dir": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Horizontal launch direction, degrees from the target line, positive to the right."
    },
    "spin": {
      "type": "number",
      "minimum": 0,
      "exclusiveMaximum": 20000,
      "description": "Total spin, rpm. Required unless back_spin and side_spin are sent."
    },
    "spin_axis": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Tilt of the spin axis, degrees, positive to the right (the ball curves right). 0 when absent."
    },
    "back_spin": {
      "type": "number",
      "minimum": 0,
      "exclusiveMaximum": 20000,
      "description": "Back spin, rpm. With side_spin, the alternative to spin and spin_axis."
    },
    "side_spin": {
      "type": "number",
      "exclusiveMinimum": -20000,
      "exclusiveMaximum": 20000,
      "description": "Side spin, rpm, positive to the right. With back_spin, the alternative to spin and spin_axis."
    },
    "club_speed": {
      "type": "number",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 100,
      "description": "Club head speed just before impact, m/s."
    },
    "attack": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Angle of attack, degrees, negative when the club moves down into the ball."
    },
    "club_path": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Club path, degrees from the target line, positive to the right."
    },
    "face": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Face angle at impact, degrees from the target line, positive to the right (open for a right-handed player)."
    },
    "dynamic_loft": {
      "type": "number",
      "minimum": -90,
      "maximum": 90,
      "description": "Dynamic loft at impact, degrees."
    },
    "carry": {
      "type": "number",
      "minimum": 0,
      "description": "Carry measured by the launch monitor, metres."
    },
    "total": {
      "type": "number",
      "minimum": 0,
      "description": "Total distance with roll measured by the launch monitor, metres."
    },
    "side": {
      "type": "number",
      "description": "Where the ball lands, metres from the target line, positive to the right."
    },
    "total_side": {
      "type": "number",
      "description": "Where the ball stops, metres from the target line, positive to the right."
    },
    "apex": {
      "type": "number",
      "minimum": 0,
      "description": "Highest point of the flight, metres."
    },
    "landing": {
      "type": "number",
      "minimum": 0,
      "maximum": 90,
      "description": "Landing angle, degrees."
    },
    "hang": {
      "type": "number",
      "minimum": 0,
      "description": "Time in the air, seconds."
    }
  },
  "additionalProperties": true,
  "examples": [
    {
      "format": "morris-shot",
      "version": "1.0",
      "device": "Bay 1",
      "shot_number": 12,
      "time": "2026-12-03T12:00:00Z",
      "handed": "RH",
      "club": "7i",
      "ball_speed": 52.3,
      "launch": 16.2,
      "launch_dir": -1.4,
      "spin": 6800,
      "spin_axis": 2.1,
      "club_speed": 38.5,
      "attack": -3.1,
      "club_path": 1.2,
      "face": 0.4,
      "dynamic_loft": 21.0,
      "carry": 148.2,
      "total": 156.0,
      "side": -3.4,
      "apex": 27.5,
      "landing": 46.0,
      "hang": 6.1
    }
  ]
}
