Implement JsonSerializable in the Document class