{
    "description": "This document contains a schema for validating an record serialization",
    "properties": {
        "$meta": {
            "_id": "/properties/$meta",
            "type": "object"
        },
        "coord": {
            "_id": "/properties/coord",
            "properties": {
                "lat": {
                    "_id": "/properties/coord/properties/lat",
                    "description": "The latitude of this record's device",
                    "title": "Schema for Record coord.lat fields",
                    "type": "number"
                },
                "lon": {
                    "_id": "/properties/coord/properties/lon",
                    "description": "The longitude of this record's device",
                    "title": "Schema for Record coord.lon fields",
                    "type": "number"
                }
            },
            "required": [
                "lat",
                "lon"
            ],
            "type": "object"
        },
        "data": {
            "_id": "/properties/data",
            "additionalProperties": false,
            "patternProperties": {
                "^[0-9]+$": {
                    "properties": {
                        "name": {
                            "description": "The assigned name for the record point",
                            "title": "Schema for RecordPoint name fields",
                            "type": "string"
                        },
                        "unit": {
                            "default": "dimensionless",
                            "description": "The assigned pint units for the record point",
                            "title": "Schema for RecordPoint units fields",
                            "type": "string"
                        },
                        "value": {
                            "description": "The stat value of the record point",
                            "title": "Schema for RecordPoint value fields",
                            "type": [
                                "number",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "name",
                        "unit",
                        "value"
                    ],
                    "type": "object"
                }
            },
            "properties": {
                "/": {}
            },
            "type": "object"
        },
        "device_name": {
            "_id": "/properties/device_name",
            "description": "The human readable name of the record's device",
            "title": "Schema for Record device_name fields",
            "type": "string"
        },
        "name": {
            "_id": "/properties/name",
            "description": "The unique reference name of the record's device",
            "title": "Schema for Record name fields",
            "type": "string"
        },
        "parsed": {
            "_id": "/properties/parsed",
            "additionalProperties": false,
            "patternProperties": {
                "^[a-z_-]+$": {
                    "properties": {
                        "unit": {
                            "description": "The assigned pint units of the record's parsed record point",
                            "title": "Schema for parsed RecordPoint units fields",
                            "type": "string"
                        },
                        "value": {
                            "description": "The assigned value of the record's parsed record point",
                            "title": "Schema for parsed RecordPoint value fields",
                            "type": [
                                "number",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "unit",
                        "value"
                    ],
                    "type": "object"
                }
            },
            "properties": {
                "/": {}
            },
            "type": "object"
        },
        "timestamp": {
            "_id": "/properties/timestamp",
            "description": "Time that the record was created",
            "title": "Schema for Record timestamp fields",
            "type": "number"
        },
        "ttl": {
            "_id": "/properties/ttl",
            "description": "The time for a record to stay alive",
            "title": "Schema for Record TTL fields",
            "type": "number"
        },
        "type": {
            "_id": "/properties/type",
            "default": "UNKNOWN",
            "description": "Must be one of the supported devices types, by name",
            "title": "Schema for Record type fields",
            "type": "string"
        }
    },
    "required": [
        "name",
        "device_name",
        "data",
        "parsed",
        "coord",
        "timestamp",
        "ttl",
        "type"
    ],
    "title": "Schema for Records.",
    "type": "object"
}