Skip to content

Commit

Permalink
Issue461:Support for complex datatypes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Bjorkengren committed Apr 11, 2023
1 parent bce9169 commit 54524ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion spec/VISSv2_Core.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,22 @@ <h2>Data representation</h2>
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".<br>
The "ts" value MUST be a string as specified in <a href="#timestamp"></a>, 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 <a href="https://covesa.github.io/vehicle_signal_specification/rule_set/data_entry/data_types/">VSS Data Types</a>.<br>
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".<br>
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<br>
```
struct {
field1 <datatype>
field2 <datatype>
}
```
is represented by the following JSON object<br>
{"field1":"X", "field2":"Y"}<br>
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.<br>
For representation of multiple data points, see <a href="#response-syntax"></a>.<br>
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.
Expand Down
4 changes: 2 additions & 2 deletions spec/VISSv2_Transport.html
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ <h2>Update</h2>
<tbody>
<tr><th rowspan="5"><dfn data-dfn-type="dfn" id="dfn-setrequest">setRequest</dfn></th><td><a href="#dfn-action">action</a></td><td><a href="#action-def">Action</a></td><td>Yes</td></tr>
<tr><td><a href="#dfn-path">path</a></td><td>string</td><td>Yes</td></tr>
<tr><td><a href="#dfn-value">value</a></td><td>string</td><td>Yes</td></tr>
<tr><td><a href="#dfn-value">value</a></td><td>string/array/object</td><td>Yes</td></tr>
<tr><td><a href="#dfn-authorization">authorization</a></td><td>string</td><td>Optional</td></tr>
<tr><td><a href="#dfn-requestid">requestId</a></td><td>string</td><td>Yes</td></tr>
</tbody>
Expand Down Expand Up @@ -1595,7 +1595,7 @@ <h2>JSON Schema Definitions</h2>
"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.",
Expand Down

0 comments on commit 54524ad

Please sign in to comment.