Commit Graph
26 Commits
Author SHA1 Message Date
Alexis Christoforides fbea921536 [tests] Add tests for Bug #23058 and polymorphism/known types in DataContractJsonSerializer. 2014-10-07 16:24:41 -07:00
Sebastien Pouliot 13ff02dc31 [System.ServiceModel.Web] Fix issue with types explicitly implementing IDictionary or IDictionary<,>
Issue: The previous code, with new tests [1], failed when the linker was
enabled.

That was caused because the code looks for the Keys and Item properties
getter using reflection. The linker handled that imperfectly (it left
some holes), in part because:

* System.Collections.Generic.IDictionary`2 does not implement
  System.Collections.IDictionary; and

* It preserved the explicit methods - not the implicit one that were
  used the the reflection-based code;

That later fact is also a bug (without the linker involvment) and solved
by this commit. A unit test was added to show the issue (NRE).

The patch also avoid the use of reflection for IDictionary since we can
simply typecast to get the same result (without the additional cost).
2014-05-26 17:27:26 -04:00
Antoine Cailliau b2b269b1e8 [Fix] DataContractJsonSerializer fails serializing/deserializing collections 2014-04-16 15:10:17 +02:00
Jonathan Pryor eda41be355 Support deserializing relative Uris. Fixes #15169.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=15169
2013-10-03 11:06:21 -04:00
Atsushi Eno 8a10b06610 Fix bug #13485: retrieve private fields and properties in serialization. 2013-08-05 15:36:24 +09:00
Jonathan Pryor e35e45293b [System.ServiceModel.Web] Support null as value for DateTime? field.
Fixes assistly #5863.
2012-01-04 16:35:02 -05:00
Miguel de Icaza 88e2387665 Extend JsonSerializerReader to support nullables and parse a wider range of Date formats, fixes x#163 2011-11-24 01:29:27 -05:00
Atsushi Eno 3f0fe0dcde IDictionary`2 serialization support was missing in DataContractJsonSerializer.
Fixed bug #685042.
2011-04-05 13:19:54 +09:00
Rolf Bjarne Kvinge f7a0fde4c6 JsonSerializationWriter: handle char values 2010-09-24 12:11:36 +02:00
Atsushi Eno 3e59168e9d 2010-07-06 Atsushi Enomoto <[email protected]>
* TypeMap.cs :
	  Do not try to add static members as serialization targets.
	  Support OnDeserializing and OnDeserialized. Fixed bug #615800.

	* DataContractJsonSerializerTest.cs : add test for bug #615800.


svn path=/trunk/mcs/; revision=159958
2010-07-06 13:41:08 +00:00
Atsushi Eno 6ce2b49f94 2010-07-06 Atsushi Enomoto <[email protected]>
* TypeMap.cs : when an object is null, return null, not just an 
	  uninitialized object.

	* DataContractJsonSerializerTest.cs : add test for bug #615801.


svn path=/trunk/mcs/; revision=159944
2010-07-06 09:08:57 +00:00
Atsushi Eno 546b5d35f2 2010-04-05 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializerTest.cs : don't use ToUniversalTime()
	  which makes test results timezone dependent.


svn path=/trunk/mcs/; revision=154780
2010-04-05 05:57:39 +00:00
Atsushi Eno fb01abdaa2 2010-03-10 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializerTest.cs : oops, the test was careless.
	  Use fixed date.


svn path=/trunk/mcs/; revision=153390
2010-03-10 08:29:40 +00:00
Atsushi Eno 2e11b2e4fa 2010-03-09 Atsushi Enomoto <[email protected]>
* JsonSerializationWriter.cs, JsonSerializationReader.cs,
	  JsonWriter.cs : Fix DateTime serialization and "\/" string escape
	  issues. Fixed bug #586169.

	* DataContractJsonSerializerTest.cs : add test for bug #586169.
	* JsonWriterTest.cs : add standalone write case for "\/".


svn path=/trunk/mcs/; revision=153318
2010-03-09 11:21:24 +00:00
Atsushi Eno 9579012ec5 2010-01-27 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializer.cs : KnownTypes does not include root
	  type. Fixed bug #573689.

	* DataContractJsonSerializerTest.cs :
	  enable TypeIsNotPartsOfKnownTypes(), and add more related tests.


svn path=/trunk/mcs/; revision=150279
2010-01-27 06:17:48 +00:00
Atsushi Eno 691da3318e 2010-01-27 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializerTest.cs : make some tests narrow down
	  possible cause of errors to detect expected errors more precisely.


svn path=/trunk/mcs/; revision=150278
2010-01-27 06:06:21 +00:00
Atsushi Eno 6cd5a57fc3 2010-01-27 Atsushi Enomoto <[email protected]>
* JsonSerializationReader.cs : "null" for string should be read as
	  null, not String.Empty. Fixed bug #573690.

	* DataContractJsonSerializerTest.cs : null-string case is working.


svn path=/trunk/mcs/; revision=150276
2010-01-27 05:36:54 +00:00
Atsushi Eno ae084ccf3e 2010-01-27 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializerTest.cs : invalidate previous non-working
	  tests.


svn path=/trunk/mcs/; revision=150275
2010-01-27 05:26:00 +00:00
Sebastien Pouliot 4ec2a8c5a3 2010-01-25 Sebastien Pouliot <[email protected]>
* DataContractJsonSerializerTest.cs: Add non-working test cases
	for null-string, known types and handling floating point special
	values


svn path=/trunk/mcs/; revision=150151
2010-01-25 21:00:38 +00:00
Chris Toshok f231a6cb9b in System.Runtime.Serialization.Json:
2009-12-11  Chris Toshok  <[email protected]>

	* TypeMap.cs (CreateDefaultTypeMap): only include non-public
	property info when dealing with KeyValuePair<,>.  This is *not*
	the way MS handles it, but we emulate things much better with this
	hack.

in test/System.Runtime.Serialization.Json/:
2009-12-11  Chris Toshok  <[email protected]>

	* DataContractJsonSerializerTest.cs: add a test case for
	non-public properties.


svn path=/trunk/mcs/; revision=148184
2009-12-12 00:14:23 +00:00
Atsushi Eno f2689b52df 2009-11-20 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializer.cs, JsonReader.cs : Silverlight uses
	  LAME parser that allows object member name as *raw* string
	  without double-quotes. (This also reverts the previous change.)

	* DataContractJsonSerializerTest.cs : added ignored test case that
	  verifies 2.1 behavior (with another case that justifies removal
	  of the previous hack).


svn path=/trunk/mcs/; revision=146599
2009-11-20 06:07:51 +00:00
Atsushi Eno ae41bed338 2009-10-08 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializer.cs, JsonSerializationWriter.cs:
	  alwaysEmitTypeInformation is  false by default. It is for __type
	  attribute, not for type attribute. __type name is always with ":#".
	* TypeMap.cs : sort members in default typemap (it is ordered).
	  Uncomment EmitDefaultValue.
	* JsonWriter.cs : handle "null" string (it is somewhat messy).

	* WebMessageEncoder.cs : use alwaysEmitTypeInformation to output
	  object __type.

	* DataContractJsonSerializerTest.cs : added test for
	  alwaysEmitTypeInformation argument.


svn path=/trunk/mcs/; revision=143748
2009-10-08 09:55:36 +00:00
Atsushi Eno f7306fc799 2009-09-07 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializerTest.cs : fix non-datacontract
	  serialization test. It depended on IPAddress field internals
	  (runtime serialization incompatibility).


svn path=/trunk/mcs/; revision=141412
2009-09-07 09:47:23 +00:00
Atsushi Eno 276f8e262c 2009-02-02 Atsushi Enomoto <[email protected]>
* TypeMap.cs : allow get-only collections. Note that they are not
	  always deserializable (in .NET either).

	* DataContractJsonSerializerTest.cs : fixed some tests to match
	  .NET RTM behavior. Added read-only collection case, (but [Ignore]d).


svn path=/trunk/mcs/; revision=125332
2009-02-02 10:50:33 +00:00
Atsushi Eno 70db8e61e3 2009-02-02 Atsushi Enomoto <[email protected]>
* TypeMap.cs : DataContractJsonSerializer in RTM does not seem to
	  reject contract-less types. So populate map for public members.
	* DataContractJsonSerializer.cs : close XmlWriter to flush stream
	  (and it closes the stream by default).

	* DataContractJsonSerializerTest.cs : added test for contract-less
	  serialization.

	* Makefile : add -d:NET_3_5.


svn path=/trunk/mcs/; revision=125328
2009-02-02 09:38:03 +00:00
Jb Evain 982e3b35a4 move to from olive to mcs
svn path=/trunk/mcs/; revision=111188
2008-08-20 21:25:05 +00:00