From 54524ad35db6ee9e4227851ab7e3a9aac3eb5526 Mon Sep 17 00:00:00 2001 From: Ulf Bjorkengren Date: Tue, 11 Apr 2023 14:55:16 +0200 Subject: [PATCH] Issue461:Support for complex datatypes. --- spec/VISSv2_Core.html | 14 +++++++++++++- spec/VISSv2_Transport.html | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/spec/VISSv2_Core.html b/spec/VISSv2_Core.html index 579b0f0..13f8389 100644 --- a/spec/VISSv2_Core.html +++ b/spec/VISSv2_Core.html @@ -302,10 +302,22 @@

Data representation

A single data point is in the message payload represented by a value and an associated timestamp, in JSON represented by two key-value pairs with the key names "value" and "ts".
The "ts" value MUST be a string as specified in , while the "value" value MUST be a string, - or an array of strings for array type signals, + an array of strings for array type signals, or an object for complex datatypes, see VSS Data Types.
In the case of the value being a number, it MUST follow the number formats as specified in [[RFC8259]]. A boolean value is represented by "true" or "false".
+ In the case of the value being a complex datatype represented by a struct, it is represented as a JSON object as shown below. + A struct with the following declaration
+ ``` + struct { + field1 + field2 + } + ``` + is represented by the following JSON object
+ {"field1":"X", "field2":"Y"}
+ where X and Y are the actual values of respective datatype, here represented for simplicity as string values. + The datatype of a field of the struct may be any datatype suported by VSS, including a struct.
For representation of multiple data points, see .
If data is represented incorrectly, then an error message with number 400, and reason "Bad data" MUST be returned. A specific case of this is if an array of data elements does not contain the number expected by the server. diff --git a/spec/VISSv2_Transport.html b/spec/VISSv2_Transport.html index 3ed6740..e2c731a 100644 --- a/spec/VISSv2_Transport.html +++ b/spec/VISSv2_Transport.html @@ -925,7 +925,7 @@

Update

setRequestactionActionYes pathstringYes - valuestringYes + valuestring/array/objectYes authorizationstringOptional requestIdstringYes @@ -1595,7 +1595,7 @@

JSON Schema Definitions

"properties": { "value": { "description": "The value related to the associated path.", - "type": "string" + "type": "string/array/object" }, "ts": { "description": "Time of the value capture. For its format, see [[viss2-core]], Timestamps chapter.",