{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "positiveNumber": {
            "type": "number",
            "minimum": 0
        },
        "returnTipHeightRange": {
            "type": "number",
            "minimum": 0.25,
            "maximum": 1.25
        },
        "idleCurrentRange": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1.0
        },
        "xyzArray": {
            "type": "array",
            "description": "Array of 3 numbers, [x, y, z]",
            "items": {
                "type": "number"
            },
            "minItems": 3,
            "maxItems": 3
        },
        "linearEquations": {
            "description": "Array containing any number of 3-arrays. Each inner 3-array describes a line segment: [boundary, slope, intercept]. So [1, 2, 3] would mean 'where (next_boundary > x >= 1), y = 2x + 3'",
            "type": "array",
            "items": {
                "type": "array",
                "items": {
                    "type": "number"
                },
                "minItems": 3,
                "maxItems": 3
            }
        },
        "liquidHandlingSpecs": {
            "description": "Object containing linear equations for translating between uL of liquid and mm of plunger travel. There is one linear equation for aspiration and one for dispense",
            "type": "object",
            "required": [
                "aspirate",
                "dispense"
            ],
            "additionalProperties": false,
            "properties": {
                "aspirate": {
                    "$ref": "#/definitions/linearEquations"
                },
                "dispense": {
                    "$ref": "#/definitions/linearEquations"
                }
            }
        },
        "editConfigurations": {
            "type": "object",
            "description": "Object allowing you to modify a config",
            "required": [
                "value"
            ],
            "properties": {
                "value": {
                    "type": [
                        "number",
                        "array"
                    ]
                },
                "min": {
                    "type": "number"
                },
                "max": {
                    "type": "number"
                },
                "units": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "displayName": {
                    "type": "string"
                }
            }
        }
    },
    "type": "object",
    "additionalProperties": false,
    "required": [
        "config",
        "mutableConfigs"
    ],
    "properties": {
        "config": {
            "description": "Version-level pipette specifications, which may vary across different versions of the same pipette",
            "type": "object",
            "$comment": "Example key: 'p10_single_v1.3'",
            "patternProperties": {
                ".*": {
                    "required": [
                        "name",
                        "top",
                        "bottom",
                        "blowout",
                        "dropTip",
                        "pickUpCurrent",
                        "pickUpDistance",
                        "pickUpIncrement",
                        "pickUpPresses",
                        "pickUpSpeed",
                        "modelOffset",
                        "plungerCurrent",
                        "dropTipCurrent",
                        "dropTipSpeed",
                        "ulPerMm",
                        "tipLength"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "description": "reference to name of this version, should match a key in corresponding pipetteNameSpecs.json file",
                            "type": "string"
                        },
                        "backCompatNames": {
                            "description": "Optional reference for name of backwards compatible pipette corresponding to a key in pipetteNameSpecs.json, only relevant to gen2 pipettes",
                            "type": "array"
                        },
                        "top": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "bottom": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "blowout": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "dropTip": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "pickUpCurrent": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "pickUpDistance": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "pickUpPresses": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "pickUpIncrement": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "pickUpSpeed": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "modelOffset": {
                            "$ref": "#/definitions/xyzArray"
                        },
                        "plungerCurrent": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "dropTipCurrent": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "dropTipSpeed": {
                            "$ref": "#/definitions/editConfigurations"
                        },
                        "ulPerMm": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/liquidHandlingSpecs"
                            }
                        },
                        "quirks": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "tipLength": {
                            "type": "object",
                            "value": {
                                "$ref": "#/definitions/positiveNumber"
                            }
                        },
                        "idleCurrent": {
                            "$ref": "#/definitions/idleCurrentRange"
                        },
                        "returnTipHeight": {
                            "$ref": "#/definitions/returnTipHeightRange"
                        },
                        "tipOverlap": {
                            "type": "object",
                            "description": "Map of tip overlap values with defaults",
                            "required": [
                                "default"
                            ],
                            "$comment": "Other keys in here should be labware URIs",
                            "properties": {
                                "default": {
                                    "type": "number"
                                }
                            },
                            "additionalProperties": {
                                "type": "number"
                            }
                        }
                    }
                }
            }
        },
        "mutableConfigs": {
            "type": "array",
            "description": "Array of mutable configs for a given pipette",
            "items": {
                "type": "string"
            }
        },
        "validQuirks": {
            "type": "array",
            "description": "Array of valid quirks for a given pipette",
            "items": {
                "type": "string"
            }
        }
    }
}