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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to