View Issue Details

IDProjectCategoryView StatusLast Update
000788310000-006: MappingsSpecpublic2023-01-24 17:06
ReporterKevin Herron (Inductive Automation) Assigned ToRandy Armstrong  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.04 
Target Version1.05.03 RC1Fixed in Version1.05.03 RC1 
Summary0007883: OPC UA JSON encoding has no recommendation on treatment of null values for fields of built-in types
Description

In Part 6 while describing the OPC UA JSON encoding the spec is clear that structure fields with a null value are omitted from the JSON object, but for all of the built-in types, which are defined in the spec before the encoding for structures, no specific recommendation is given and thus it's not clear what to do.

That is, given e.g. a DiagnosticInfo:

var diagnosticInfo = new DiagnosticInfo(
0,
1,
2,
3,
"foo",
null,
null
);

Is the correct encoding:

{"SymbolicId":1,"NamespaceUri":0,"Locale":2,"LocalizedText":3,"AdditionalInfo":"foo","InnerStatusCode":null,"InnerDiagnosticInfo":null}

or:

{"SymbolicId":1,"NamespaceUri":0,"Locale":2,"LocalizedText":3,"AdditionalInfo":"foo"}

Speaking with Randy he said the recommendation is to omit the fields. The spec should explicitly mention this, either in each "struct-like" built-in type, or as a general recommendation before they are defined.

TagsNo tags attached.
Commit Version
Fix Due Date

Activities

Randy Armstrong

2022-12-29 15:47

administrator   ~0018373

Table 38 – JSON Encoding Rules for Structures seems to already do this.

Randy Armstrong

2023-01-24 17:02

administrator   ~0018568

Updated DiagnosticInfo to explicitly specify default values for all fields an indicate that fields are omitted if equal to the default value.

Jim Luth

2023-01-24 17:06

administrator   ~0018571

Agreed to changes edited in web meeting.

Issue History

Date Modified Username Field Change
2022-03-23 12:21 Kevin Herron (Inductive Automation) New Issue
2022-07-12 16:07 Jim Luth Target Version => 1.05.03 RC1
2022-07-12 16:07 Jim Luth Assigned To => Randy Armstrong
2022-07-12 16:07 Jim Luth Status new => assigned
2022-12-29 15:47 Randy Armstrong Status assigned => resolved
2022-12-29 15:47 Randy Armstrong Resolution open => no change required
2022-12-29 15:47 Randy Armstrong Note Added: 0018373
2023-01-24 17:02 Randy Armstrong Note Added: 0018568
2023-01-24 17:02 Randy Armstrong Resolution no change required => fixed
2023-01-24 17:06 Jim Luth Status resolved => closed
2023-01-24 17:06 Jim Luth Fixed in Version => 1.05.03 RC1
2023-01-24 17:06 Jim Luth Note Added: 0018571