Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4533

Provide more informative exception on deserialization of invalid type arguments of generic types

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • None
    • None
    • Serialization

    Description

      For example, deserializing 

      "\{ \"A\" : { \"_t\" : \"System.Collections.Generic.List`1[[InvalidType, InvalidAssembly]]\", \"_v\" : [{ \"Y\" : 1 }] }}";
      

      to

      public class MyClass
      {
         public object A { get; set; }
      }
      

      Throws "String cannot have zero length.", instead of more informative message.

      Attachments

        Activity

          People

            adelin.mbidaowona@mongodb.com Adelin Mbida Owona
            boris.dogadov@mongodb.com Boris Dogadov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: