diff --git a/messages/definitions.json b/messages/definitions.json index ac4a652..a86d860 100644 --- a/messages/definitions.json +++ b/messages/definitions.json @@ -30,9 +30,7 @@ ], "properties": { "@context": { - "type": "string", - "title": "Device context", - "description": "Context of the device" + "$ref": "#/definitions/device-context" }, "@type": { "type": "array", @@ -108,9 +106,7 @@ "description": "Description of the device", "properties": { "@context": { - "type": "string", - "title": "Device context", - "description": "Context of the device" + "$ref": "#/definitions/device-context" }, "@type": { "type": "array", @@ -282,6 +278,12 @@ "description": "The type of the relationship" }, "mediaType": { + "type": "string", + "title": "Link media type", + "description": "The media type of the link (deprecated in favour of type)", + "deprecated": true + }, + "type": { "type": "string", "title": "Link media type", "description": "The media type of the link" @@ -464,7 +466,7 @@ "type": { "type": "string", "title": "Event value type", - "description": "The type of the event value", + "description": "Event payload data schema (deprecated in favour of data.type)", "enum": [ "null", "boolean", @@ -473,34 +475,88 @@ "number", "integer", "string" - ] + ], + "deprecated": true }, "unit": { "type": "string", "title": "Event unit", - "description": "The unit of the event" + "description": "The unit of the event (deprecated in favour of data.unit)", + "deprecated": true }, "minimum": { "type": "number", "title": "Event minimum value", - "description": "The minimum value of the event" + "description": "The minimum value of the event (deprecated in favour of data.minimum)", + "deprecated": true }, "maximum": { "type": "number", "title": "Event maximum value", - "description": "The maximum value of the event" + "description": "The maximum value of the event (deprecated in favour of data.maximum)", + "deprecated": true }, "multipleOf": { "type": "number", "title": "Event value precision", - "description": "The precision of the value" + "description": "The precision of the value (deprecated in favour of data.multipleOf)", + "deprecated": true }, "enum": { "type": "array", "items": { "title": "Property values enum", - "description": "The possible values of the property", - "$ref": "#/definitions/any" + "description": "The possible values of the property (deprecated in favour of data.enum)", + "$ref": "#/definitions/any", + "deprecated": true + } + }, + "data": { + "type": "object", + "description": "Event payload data schema", + "properties": { + "type": { + "type": "string", + "title": "Event value type", + "description": "The type of the event value", + "enum": [ + "null", + "boolean", + "object", + "array", + "number", + "integer", + "string" + ] + }, + "unit": { + "type": "string", + "title": "Event unit", + "description": "The unit of the event" + }, + "minimum": { + "type": "number", + "title": "Event minimum value", + "description": "The minimum value of the event" + }, + "maximum": { + "type": "number", + "title": "Event maximum value", + "description": "The maximum value of the event" + }, + "multipleOf": { + "type": "number", + "title": "Event value precision", + "description": "The precision of the value" + }, + "enum": { + "type": "array", + "items": { + "title": "Property values enum", + "description": "The possible values of the property", + "$ref": "#/definitions/any" + } + } } } } @@ -701,6 +757,35 @@ } } ] + }, + "device-context": { + "oneOf": [ + { + "type": "string", + "title": "Device context", + "description": "The JSON-LD context used by the device" + }, + { + "type": "array", + "title": "Device contexts", + "description": "An array of JSON-LD contexts used by the device", + "items": { + "oneOf": [ + { + "type": "string", + "title": "Device context", + "description": "A JSON-LD context used by the device" + + }, + { + "type": "object", + "title": "Prefixed device context", + "description": "A JSON-LD context used by the device, with prefix as key and context URI as value" + } + ] + } + } + ] } } }