{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://golfsga.com/sga-ois/schema/0.1/shot-contribution.schema.json",
  "title": "SGA-OIS device contribution to a shot",
  "description": "What a device sends about one shot: the field it is about, and the values it measured in the shot record's own namespaces and shapes. The engine composes the shot record (shot-record.schema.json) from every contribution; a device never sends a whole record (06 section 10).",
  "type": "object",
  "required": [
    "type",
    "field"
  ],
  "additionalProperties": false,
  "properties": {
    "type": {
      "const": "record.shot",
      "description": "Message type discriminator. Always record.shot."
    },
    "field": {
      "type": "string",
      "maxLength": 128,
      "description": "The field this frame is about, which the engine routes and attributes on. It must be a field the device declared in provides."
    },
    "shot_id": {
      "$ref": "common.schema.json#/$defs/sgaId",
      "description": "The shot this contributes to, as the engine announced it in record.swing_detected. Never invented by the device."
    },
    "device_t_ms": {
      "$ref": "common.schema.json#/$defs/deviceMs"
    },
    "attest": {
      "$ref": "attest.schema.json#/$defs/attest"
    },
    "course": {
      "$ref": "shot-record.schema.json#/properties/course"
    },
    "player": {
      "$ref": "shot-record.schema.json#/properties/player"
    },
    "origin": {
      "$ref": "shot-record.schema.json#/properties/origin"
    },
    "environment": {
      "$ref": "shot-record.schema.json#/properties/environment"
    },
    "ambient": {
      "$ref": "shot-record.schema.json#/properties/ambient"
    },
    "club": {
      "$ref": "shot-record.schema.json#/properties/club"
    },
    "ball": {
      "$ref": "shot-record.schema.json#/properties/ball"
    },
    "putt": {
      "$ref": "shot-record.schema.json#/properties/putt"
    },
    "swing": {
      "$ref": "shot-record.schema.json#/properties/swing"
    },
    "pressure": {
      "$ref": "shot-record.schema.json#/properties/pressure"
    },
    "platform": {
      "$ref": "shot-record.schema.json#/properties/platform"
    },
    "trajectory": {
      "$ref": "shot-record.schema.json#/properties/trajectory"
    },
    "outcome": {
      "$ref": "shot-record.schema.json#/properties/outcome"
    },
    "integrity": {
      "$ref": "shot-record.schema.json#/properties/integrity"
    },
    "relayed_from": {
      "$ref": "common.schema.json#/$defs/deviceHandle",
      "description": "Sent by a relaying phone (13 section 4.1): which of the member's devices this contribution's values came from. The engine records it in the shot record's origins."
    }
  },
  "patternProperties": {
    "^x-[a-z0-9_-]+\\.": {}
  }
}
