-Marked old JsonSchema implementation as obsolete
-License headers -Documentation -Build
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if NETFX_CORE
|
||||
@@ -458,4 +459,5 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
Assert.AreEqual(0, errorMessages.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using System;
|
||||
#if NETFX_CORE
|
||||
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
||||
@@ -643,4 +644,5 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
}, "Could not resolve schema reference '#/array/one'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -775,35 +776,6 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
{
|
||||
public SortTypeFlagAsString y;
|
||||
}
|
||||
|
||||
#if !ASPNETCORE50
|
||||
[Test]
|
||||
[Ignore]
|
||||
public void GenerateSchemaWithStringEnum()
|
||||
{
|
||||
JsonSchemaGenerator jsonSchemaGenerator = new JsonSchemaGenerator();
|
||||
JsonSchema schema = jsonSchemaGenerator.Generate(typeof(Y));
|
||||
|
||||
string json = schema.ToString();
|
||||
|
||||
// NOTE: This fails because the enum is serialized as an integer and not a string.
|
||||
// NOTE: There should exist a way to serialize the enum as lowercase strings.
|
||||
Assert.AreEqual(@"{
|
||||
""type"": ""object"",
|
||||
""properties"": {
|
||||
""y"": {
|
||||
""required"": true,
|
||||
""type"": ""string"",
|
||||
""enum"": [
|
||||
""no"",
|
||||
""asc"",
|
||||
""desc""
|
||||
]
|
||||
}
|
||||
}
|
||||
}", json);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public class NullableInt32TestClass
|
||||
@@ -874,4 +846,5 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
public class BulkInsertTask_DSL
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using Newtonsoft.Json.Schema;
|
||||
#if NETFX_CORE
|
||||
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
||||
@@ -169,4 +170,5 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
Assert.AreEqual(true, model.Properties["age"].Required);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using Newtonsoft.Json.Schema;
|
||||
#if NETFX_CORE
|
||||
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
||||
@@ -121,4 +122,5 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
Assert.AreEqual(node, node.Items[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
#if !(ASPNETCORE50 || NETFX_CORE)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -119,4 +120,5 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#pragma warning restore 618
|
||||
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -584,4 +585,5 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
Assert.IsTrue(json.IsValid(schema));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
@@ -1,4 +1,30 @@
|
||||
using System;
|
||||
#region License
|
||||
// Copyright (c) 2007 James Newton-King
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the "Software"), to deal in the Software without
|
||||
// restriction, including without limitation the rights to use,
|
||||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following
|
||||
// conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@@ -149,3 +175,4 @@ namespace Newtonsoft.Json.Tests.Schema
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
Reference in New Issue
Block a user