Deserialize discriminated data to ExpandoObject

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.3
    • Component/s: Serialization
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I'm trying to deserialize entire document that contains polymorphic collection to dynamic object.
      And I expect that my collection will contain dynamic objects but I've got concrete types.
      I've created pull request with fix and unit test.

      Example data:
      var json = "{ \"Shapes\" : [

      { \"_t\" : \"Circle\", \"Radius\" : 5 }

      ,

      { \"_t\" : \"Square\", \"Side\" : 3 }

      ] }";

      Current behavior:
      typeof(Circle) == obj.Shapes[0].GetType()
      typeof(Square) == obj.Shapes[1].GetType()

      Expected:
      typeof(ExpandoObject) == obj.Shapes[0].GetType()
      typeof(ExpandoObject) == obj.Shapes[1].GetType()

            Assignee:
            Unassigned
            Reporter:
            Kool Booluk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: