-Change BSON writer to write new binary subtype

-Fix BSON reader to read the old binary subtype correctly
-Added JsonNet35BinaryCompadibility to BSON reader for incorrectly written BSON binary values
-Changed JSON schema to use required flags instead of optional as defined in JSON schema spec 3.0
-Changed JSON schema to use divisibleBy instead of maxDecimals as defined in JSON schema spec 3.0
-Fixed detection of serialization specified flag properties
-Updated to latest version of NuGet
This commit is contained in:
JamesNK
2010-12-19 00:29:41 +00:00
parent 2e7b8e5279
commit 5ccd826951
20 changed files with 194 additions and 80 deletions
@@ -139,7 +139,7 @@ namespace Newtonsoft.Json.Tests.Schema
}
[Test]
public void Optional()
public void Required()
{
string schemaJson = @"{
""description"":""A person"",
@@ -147,8 +147,8 @@ namespace Newtonsoft.Json.Tests.Schema
""properties"":
{
""name"":{""type"":""string""},
""hobbies"":{""type"":""string"",optional:true},
""age"":{""type"":""integer"",optional:true}
""hobbies"":{""type"":""string"",required:true},
""age"":{""type"":""integer"",required:true}
}
}";
@@ -158,9 +158,9 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.AreEqual(JsonSchemaType.Object, model.Type);
Assert.AreEqual(3, model.Properties.Count);
Assert.AreEqual(false, model.Properties["name"].Optional);
Assert.AreEqual(true, model.Properties["hobbies"].Optional);
Assert.AreEqual(true, model.Properties["age"].Optional);
Assert.AreEqual(false, model.Properties["name"].Required);
Assert.AreEqual(true, model.Properties["hobbies"].Required);
Assert.AreEqual(true, model.Properties["age"].Required);
}
}
}