-Added ObjectCreationHandling to JsonPropertyAttribute

-Added IValueProvider, ReflectionValueProvider, DynamicValueProvider
-Added Dynamic.snk
-Added Required enum with options Default, AllowNull and Always
-Added serialization event support to Silverlight version
-Added Converter to JsonProperty for JsonConverter
-Changed IsRequired to Required enum
-Changed schema generator to allow for Required enum options
-Changed Silverlight project version to Silverlight 3
-Improved error message when JSON array encountered for object and vice-versa when deserializing
-Improved error message for converting types when deserializing
-Improved error message from getting and setting properties when serializing and deserializing
-Fixed empty string being converted to null when deserializing
-Removed dependency on Entity Framework and LINQ to SQL assemblies
This commit is contained in:
JamesNK
2009-11-02 08:21:02 +00:00
parent b4b3905714
commit 2a63ea24e3
51 changed files with 1466 additions and 260 deletions
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Schema
}
}", json);
}
#if !PocketPC
[Test]
public void Generate_DefaultValueAttributeTestClass()
@@ -179,7 +179,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.AreEqual(JsonSchemaType.String, schema.Properties["FirstName"].Type);
Assert.AreEqual(JsonSchemaType.String | JsonSchemaType.Null, schema.Properties["MiddleName"].Type);
Assert.AreEqual(JsonSchemaType.String, schema.Properties["LastName"].Type);
Assert.AreEqual(JsonSchemaType.String | JsonSchemaType.Null, schema.Properties["LastName"].Type);
Assert.AreEqual(JsonSchemaType.String, schema.Properties["BirthDate"].Type);
}
@@ -264,7 +264,7 @@ namespace Newtonsoft.Json.Tests.Schema
JsonSchema schema = generator.Generate(typeof(CircularReferenceWithIdClass));
Assert.AreEqual(JsonSchemaType.String, schema.Properties["Name"].Type);
Assert.AreEqual(JsonSchemaType.String | JsonSchemaType.Null, schema.Properties["Name"].Type);
Assert.AreEqual("MyExplicitId", schema.Id);
Assert.AreEqual(JsonSchemaType.Object, schema.Properties["Child"].Type);
Assert.AreEqual(schema, schema.Properties["Child"]);
@@ -287,7 +287,7 @@ namespace Newtonsoft.Json.Tests.Schema
{
IList<JsonProperty> properties = base.CreateProperties(contract);
JsonPropertyCollection c = new JsonPropertyCollection();
JsonPropertyCollection c = new JsonPropertyCollection(contract);
CollectionUtils.AddRange(c, (IEnumerable)properties.Where(m => m.PropertyName != "Root"));
return c;