[Mono-bugs] [Bug 661919] New: System.Web.Extensions JSON deserialization does not support nullable value types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Dec 30 16:56:49 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=661919

https://bugzilla.novell.com/show_bug.cgi?id=661919#c0


           Summary: System.Web.Extensions JSON deserialization does not
                    support nullable value types
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: i686
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: crokusek at pacbell.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:

The DataContractJsonSerializer is filling nullable value types with 0 instead
of the true value even when a value is provided.  I would expect the nullable
value type to default to null if not provided within the stream else be set to
value provided by the stream.



Steps to reproduce the problem:
1. 


[DataContract]
public class c
{
    public c() { }

    [DataMember]
    public int? parm_id { get; set; }

    [DataMember]
    public decimal? val { get; set; }
}


2. 

string js = "{\"parm_id\":2}";
Use DataContractJsonSerializer to fill an instance with js.


Actual Results:

   parm_id contains 0.
   val contains 0

Expected Results:

   parm_id should contain 2.
   val should contain null.


How often does this happen? 

   Everytime.


Additional Information:

   Native windows returns expected results.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list