-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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user