{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Batting measurements for POST /v1/coach", "type": "object", "additionalProperties": false, "required": [ "schema_version", "discipline", "capture", "reps" ], "properties": { "schema_version": { "const": "2.0" }, "discipline": { "const": "hitting" }, "level": { "enum": [ "hs_jv", "hs_varsity", "college" ] }, "view": { "const": "face_on" }, "fps": { "type": "number", "exclusiveMinimum": 0 }, "capture": { "type": "object", "additionalProperties": false, "required": [ "ok", "reasons" ], "properties": { "ok": { "type": "boolean" }, "reasons": { "type": "array", "uniqueItems": true, "items": { "enum": [ "a_bit_blurry", "a_bit_dark", "low_fps", "low_pose_confidence", "multiple_people", "no_person", "partly_out_of_frame", "person_too_small", "player_switched", "pose_confidence_fair", "too_blurry", "too_dark", "very_low_fps", "view_uncertain", "wrong_view" ] } } }, "if": { "properties": { "ok": { "const": false } } }, "then": { "properties": { "reasons": { "minItems": 1 } } } }, "reps": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/measurement_rep" } } }, "$defs": { "metric": { "oneOf": [ { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "stride_pct_height" }, "value": { "type": [ "number", "null" ], "minimum": 10, "maximum": 120 }, "unit": { "const": "%" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "foot_plant_to_contact_ms" }, "value": { "type": [ "number", "null" ], "minimum": 30, "maximum": 800 }, "unit": { "const": "ms" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "com_drift_pct_height" }, "value": { "type": [ "number", "null" ], "minimum": -80, "maximum": 80 }, "unit": { "const": "%" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "load_tempo_s" }, "value": { "type": [ "number", "null" ], "minimum": 0.05, "maximum": 3 }, "unit": { "const": "s" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "load_launch_ratio" }, "value": { "type": [ "number", "null" ], "minimum": 0.1, "maximum": 20 }, "unit": { "const": "ratio" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "head_movement_pct_height" }, "value": { "type": [ "number", "null" ], "minimum": 0, "maximum": 40 }, "unit": { "const": "%" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "lead_knee_angle_contact_deg" }, "value": { "type": [ "number", "null" ], "minimum": 60, "maximum": 200 }, "unit": { "const": "deg" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "lateral_trunk_tilt_contact_deg" }, "value": { "type": [ "number", "null" ], "minimum": -90, "maximum": 90 }, "unit": { "const": "deg" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "hip_shoulder_separation_foot_plant_deg" }, "value": { "type": [ "number", "null" ], "minimum": -90, "maximum": 90 }, "unit": { "const": "deg" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } } ] }, "measurement_rep": { "type": "object", "additionalProperties": false, "required": [ "rep", "events_ms", "metrics", "quality" ], "properties": { "rep": { "type": "integer", "minimum": 1 }, "events_ms": { "type": "object", "additionalProperties": false, "properties": { "stance_set": { "type": "number", "minimum": 0 }, "load_start": { "type": "number", "minimum": 0 }, "stride": { "type": "number", "minimum": 0 }, "foot_contact": { "type": "number", "minimum": 0 }, "foot_plant": { "type": "number", "minimum": 0 }, "swing_start": { "type": "number", "minimum": 0 }, "contact": { "type": "number", "minimum": 0 }, "finish": { "type": "number", "minimum": 0 } } }, "metrics": { "type": "array", "minItems": 9, "maxItems": 9, "items": { "$ref": "#/$defs/metric" } }, "quality": { "type": "object", "additionalProperties": false, "required": [ "pose_conf", "blur" ], "properties": { "pose_conf": { "type": "number", "minimum": 0, "maximum": 1 }, "blur": { "type": "number", "minimum": 0, "maximum": 1 } } } } } } }