View Issue Details

IDProjectCategoryView StatusLast Update
001013810000-006: MappingsSpecpublic2025-02-04 17:19
ReporterBjarneBostrom Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version1.05.04 
Summary0010138: JSON new encodings do not define the "non-reversible-use-body-only Variant" encoding that is used by Part 14
Description

The https://reference.opcfoundation.org/Core/Part14/v105/docs/A.3.2 defines http://opcfoundation.org/UA/PubSub-Layouts/JSON-Minimal HeaderLayoutURI and gives an example
...
"Active":true,
"Temperature":25.5,
"Counter":0,
...
In the old encodings (now listed in https://reference.opcfoundation.org/Core/Part6/v105/docs/H.8) that was possible due to the Variant having the line: "For the NonReversibleEncoding, Variant values shall be encoded as a JSON value containing only the value of the Body field. The Type and Dimensions fields are dropped. Multi-dimensional arrays are encoded as a multi-dimensional JSON array as described in H.9.".

That line is missing from the new COMPACT/VERBOSE encodings. I could only find the Part 14 saying in https://reference.opcfoundation.org/Core/Part14/v105/docs/7.2.5.4:
"If the FieldEncoding1 is FALSE in the DataSetMessageContentMask, the Variant at the top level of a field is encoded as a JSON value containing only the value of the Body field. If this Variant contains an ExtensionObject, the ExtensionObject shall be encoded as a Structure without the UaTypeId field. This also applies to the Variant in a DataValue at the top level of a field."
It should be noted that the field is now 'Value' and not 'Body', unless that text is also talking about interop with the old formats.

The https://reference.opcfoundation.org/Core/Part6/v105/docs/5.4.1, has mention of "The VerboseEncoding also supports the RawData mode..." that UaType + UaTypeId fields are excluded (btw, could this be used with the COMPACT encoding?), but that leaves the JSON Object with sole Value field (+Dimensions for multidim fields) like:
...
"Active" : {
"Value" : true
},
"Temperature" : {
"Value" : 25.5
},
"Counter" : {
"Value" : 0
},
...

In my opinion most likely the RawData format should be specified that the 'Value' field of Variant is in-lined (for the top-lvl Variants) for scalar and 1-dim array cases (and for multidim it should be what would currently happen, JSON object with Value and Dimension fields of the Variant).

TagsNo tags attached.
Commit Version
Fix Due Date

Activities

Jim Luth

2025-02-04 17:18

administrator   ~0022365

This was done on purpose. The non-decodable optimizations are for Part 14 only, hence they are defined only in Part 14.

Issue History

Date Modified Username Field Change
2025-02-04 13:20 BjarneBostrom New Issue
2025-02-04 17:18 Jim Luth Note Added: 0022365
2025-02-04 17:19 Jim Luth Status new => closed
2025-02-04 17:19 Jim Luth Resolution open => no change required