'Returns a JSON string encoding the attributes of this object.
References to other objects are serialized as references
(just the object ID and type info), so the deserializer
will need to separately have the full attributes of those
other objects.
There\'s no corresponding from_json_string() because to
deserialize an object is normally done in the context of a
Document (since the Document can resolve references).
For most purposes it\'s best to serialize and deserialize
entire documents.
Args:
include_defaults (bool) : whether to include attributes
that haven\'t been changed from the default'

def to_json_string(self, include_defaults):

    json_like = self._to_json_like(include_defaults=include_defaults)
    json_like['id'] = self._id
    return serialize_json(json_like)
