For the ReversibleEncoding, ExtensionObject values shall be encoded as a JSON object with the fields shown in Table H.6.
Table H.6 – JSON Object Definition for an ExtensionObject
Name |
Description |
TypeId |
The NodeId of a DataTypeEncoding Node or a DataType Node formatted using the rules in H.2. |
Encoding |
The format of the Body field encoded as a JSON number. This value is 0 if the body is Structure encoded as a JSON object. This value is 1 if the body is a ByteString value encoded as a JSON string. This value is 2 if the body is a XmlElement value encoded as a JSON string. This field is omitted if the value is 0. |
Body |
Body of the ExtensionObject. The type of this field is specified by the Encoding field. If the Body is empty, the ExtensionObject is NULL and is omitted or encoded as a JSON null. |
For the NonReversibleEncoding, ExtensionObject values shall be encoded as a JSON value containing only the value of the Body field. The TypeId and Encoding fields are dropped.
Decoders that support the NonReversibleEncoding need to have out of band knowledge of the encoded Structure or treat the value as a generic JSON object.