{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "eyeData": {
      "type": "object",
      "properties": {
        "pupilDistance": {
          "description": "Distance from bridge of nose to pupil when infinity-focused (in mm).",
          "type": "number"
        },
        "dominant": {
          "type": "boolean"
        },
        "correction": {
          "title": "Vision correction information",
          "description": "These optional parameters, found on an eyeglass prescription, may be used to help provide a customized display experience.",
          "type": "object",
          "properties": {
            "distance": {
              "description": "Distance vision correction (DV)",
              "type": "object",
              "properties": {
                "spherical": {
                  "title": "Spherical correction (diopters)",
                  "description": "This is the most common correction value or 'power'",
                  "type": "number",
                  "default": 0
                },
                "cylindrical": {
                  "title": "Astigmatism - cylindical correction (diopters)",
                  "description": "This is the astigmatism value measured in positive or negative diopters",
                  "type": "number",
                  "default": 0
                },
                "axis": {
                  "title": "Astigmatism - axis (degrees)",
                  "description": "This is the astigmatism value measured as an angle",
                  "type": "number"
                }
              },
              "dependencies": {
                "cylindrical": [
                  "axis"
                ],
                "axis": [
                  "cylindrical"
                ]
              }
            },
            "addNear": {
              "description": "Near vision correction (NV) - 'add'",
              "type": "object",
              "properties": {
                "spherical": {
                  "title": "Spherical correction (diopters)",
                  "type": "number",
                  "default": 0
                }
              }
            }
          }
        }
      }
    }
  },
  "type": "object",
  "properties": {
    "personalSettings": {
      "title": "OSVR User Descriptor",
      "description": "This schema documents the user parameters available for optimizing and customizing system behaviors.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "gender": {
          "description": "If specified, may be used to provide defaults for some anthropometric data.",
          "type": "string"
        },
        "eyes": {
          "description": "IPD and dominant eye designations. Total IPD can be derived by adding together the pdLeft and pdRight valuse.",
          "type": "object",
          "properties": {
            "left": {
              "allOf": [
                {
                  "title": "Left eye (OS)"
                },
                {
                  "$ref": "#/definitions/eyeData"
                }
              ]
            },
            "right": {
              "allOf": [
                {
                  "title": "Right eye (OD)"
                },
                {
                  "$ref": "#/definitions/eyeData"
                }
              ]
            }
          }
        },
        "anthropometric": {
          "description": "General distance measures to improve immersion.",
          "type": "object",
          "properties": {
            "standingEyeHeight": {
              "title": "Standing eye height (m)",
              "type": "number"
            },
            "seatedEyeHeight": {
              "title": "Seated eye height (m)",
              "type": "number"
            },
            "eyeToNeck": {
              "title": "?? what units? neck models have at least 2 if not 3 dimensions...",
              "type": "number"
            }
          }
        }
      }
    }
  },
  "required": [
    "personalSettings"
  ]
}