Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-3466

FIT: Performer using default transcoder cannot get raw content

    XMLWordPrintable

Details

    • Task
    • Resolution: Duplicate
    • Major
    • 3.4.11
    • None
    • None
    • None
    • 2
    • SDK32, SDK34

    Description

      Motivation
      -----------
      In Java, most result classes have some helper methods such as ContentAsBytes (or ContentRaw), ContentAsJson, ContentAsString and ContentAs. In .NET we only have ContentAs<T>, and if no custom Transcoder/Serializer is passed by the user in the options, the JsonTranscoder with DefaultSerializer is used. This one does not support byte arrays, so there's no way for the .NET SDK to do result.ContentAs<bytes[]>() without passing a RawBinaryTranscoder in the operation's options.
      But that's effectively correct behaviour from the SDK, since the JsonTranscoder has explicit handling to do:
      if (typeof(T) == typeof(byte[]))

      { [...] throw new UnsupportedException("JsonTranscoder does not support byte arrays."); }

      Chosen Fix
      -----------
      Add a ContentRaw() method to LookupInResult (internal class) and extend it inside ILookupInResultExtensions.cs.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              emilien.bevierre Emilien Bevierre
              emilien.bevierre Emilien Bevierre
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty