-Added ItemIsReference, ItemReferenceLoopHandling, ItemTypeNameHandling, ItemConverterType to JsonPropertyAttribute

This commit is contained in:
James Newton-King
2012-05-05 20:30:02 +12:00
parent 0e22f39e12
commit 2dfd0bc940
14 changed files with 1284 additions and 630 deletions
@@ -751,6 +751,33 @@ namespace Newtonsoft.Json.Tests.Schema
}
}", json);
}
[Test]
public void GenerateForNullableInt32()
{
JsonSchemaGenerator jsonSchemaGenerator = new JsonSchemaGenerator();
JsonSchema jsonSchema = jsonSchemaGenerator.Generate(typeof(NullableInt32TestClass));
string json = jsonSchema.ToString();
Assert.AreEqual(@"{
""type"": ""object"",
""properties"": {
""Value"": {
""required"": true,
""type"": [
""integer"",
""null""
]
}
}
}", json);
}
}
public class NullableInt32TestClass
{
public int? Value { get; set; }
}
public class DMDSLBase