{
    "$schema": "http://json-schema.org/draft/2019-09/schema",
    "$id": "https://senseye.io/v1/json-schema.json",
    "type": "array",
    "title": "Senseye JSON Schema",
    "items": {
        "type": "object",
        "title": "Asset Data",
        "required": [
            "assetId",
            "dataPoints"
        ],
        "properties": {
            "assetId": {
                "type": "string",
                "title": "The asset's ID"
            },
            "dataPoints": {
                "type": "array",
                "title": "Datapoints from the asset",
                "items": {
                    "type": "object",
                    "title": "Data collected from a given timestamp",
                    "required": [
                        "timestamp",
                        "measures"
                    ],
                    "properties": {
                        "timestamp": {
                            "type": "string",
                            "title": "In RFC3339 format"
                        },
                        "measures": {
                            "type": "array",
                            "title": "An array of measurements",
                            "items": {
                                "type": "object",
                                "title": "A measurement",
                                "required": [
                                    "name",
                                    "value"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "title": "Measure name"
                                    },
                                    "value": {
                                        "type": ["number", "string"],
                                        "title": "The recorded value"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}