Bug: TypeNameHandling.All doesn't work for object[]

Jul 2, 2010 at 7:41 PM

I have a field definition like this:

        [JsonProperty(TypeNameHandling=TypeNameHandling.All)]
        object[] MyValues;

When I serialize the object using BsonWriter, a type name is written for the array itself, but not for the objects in the array.

I also tried TypeNameHandling.Arrays and TypeNameHandling.Objects, but that didn't fix the problem either.   It's a bug, right?

Coordinator
Jul 3, 2010 at 8:41 AM

That property doesn't apply to values of the collection, just the collection itself. See here for more info: http://json.codeplex.com/Thread/View.aspx?ThreadId=216687

Coordinator
Jul 3, 2010 at 9:54 AM

TypeNameHandling.Auto added.