# json schema which all uploaded calibration set
# files are validated against
calibration_set_schema = {
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "calibration set schema",
    "type": "object",
    "properties": {
        "calibration_set": {
            "type": "array",
            "uniqueItems": True,
            "items": {
                "type": "object",
                "properties": {
                    "id": {"type": "number"},
                    "value1": {"type": "number"},
                    "value2": {"type": "number"}
                },
                "required": ["id", "value1", "value2"]
            }
        },
        "serial": {"type": "string"},
        "valid_to": {"type": "string", "format": "date"}
    },
    "required": ["calibration_set", "serial", "valid_to"],
    "additionalProperties": False
}

