icubilla / jsonexserializer

Automatically exported from code.google.com/p/jsonexserializer
0 stars 0 forks source link

A nullable value that is set is serialized with a casting prefix, which seems redundant. #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.
Serialize some nullable value that is of type "System.Guid?" or 
"Nullable<System.Guid>".

What is the expected output? What do you see instead?

Expected:
"Id":"5b23029c-3a59-454b-8bf0-7ce3dcec1f3c"

Instead:
"Id":(System.Guid)"5b23029c-3a59-454b-8bf0-7ce3dcec1f3c"

What version of the product are you using? 
2.1.1.144

On what operating system?
Vista 32bit

Please provide any additional information below.

When types are serialized using jsonexlib, I don't like to see any type 
information that is redundant in the output.

Probably a custom type converter must be introduced for Nullables?

Original issue reported on code.google.com by paramatrix@gmail.com on 12 Nov 2008 at 9:12

GoogleCodeExporter commented 9 years ago
It appears that when calling GetType() off of an instance of Nullable<Guid> it 
returns Guid.  May need some special handling so that Nullable types are 
considered 
equal to their regular types and no type info is written.

Original comment by elliott....@gmail.com on 15 Nov 2008 at 4:19

GoogleCodeExporter commented 9 years ago

Original comment by elliott....@gmail.com on 16 Nov 2008 at 5:47

GoogleCodeExporter commented 9 years ago
Tests for equality now use a helper method which equates a nullable type with 
its 
base type.

Original comment by elliott....@gmail.com on 25 Jan 2009 at 4:44

GoogleCodeExporter commented 9 years ago
3.0 Release

Original comment by elliott....@gmail.com on 26 Jan 2009 at 2:22