toJson method
Convert the message to a JSON map
Implementation
@override
Map<String, dynamic> toJson() {
return {
'type': type.value,
'documentId': documentId,
'author': author.toString(),
'versionVector': _encodeVersionVector(versionVector),
'protocolVersion': protocolVersion,
if (capabilities != null) ...{
'capabilities': capabilities!.toJson(),
// Absent means "not complete", which is what a peer that predates the
// field meant too.
if (capabilities!.complete) 'capabilitiesComplete': true,
},
};
}