StructuredDataMessage implements MultiFormatStringBuilderFormattable and returns XML as one of its supported encodings. When StructuredDataMessage is serialized to XML, it omits the message provided at construction:
new StructuredDataMessage("an id", "a message", "a type");
gets encoded to XML as:
<StructuredData>
<type>a type</type>
<id>an id</id>
<Map>
</Map>
</StructuredData>
whereas, the following was expected:
<StructuredData>
<type>a type</type>
<id>an id</id>
<Map>
<Entry key="message">foo</Entry>
</Map>
</StructuredData>
There is another problem: What if the user also explicitly provides a message entry:
var sdm = new StructuredDataMessage("an id", "a message", "a type");
sdm.put("message", "foo");
StructuredDataMessageimplementsMultiFormatStringBuilderFormattableand returnsXMLas one of its supported encodings. WhenStructuredDataMessageis serialized to XML, it omits themessageprovided at construction:gets encoded to XML as:
whereas, the following was expected:
There is another problem: What if the user also explicitly provides a
messageentry: