Newtonsoft.Json.Schema
4.0.2-beta1
Prefix Reserved
Requires NuGet 2.12 or higher.
dotnet add package Newtonsoft.Json.Schema --version 4.0.2-beta1
NuGet\Install-Package Newtonsoft.Json.Schema -Version 4.0.2-beta1
<PackageReference Include="Newtonsoft.Json.Schema" Version="4.0.2-beta1" />
paket add Newtonsoft.Json.Schema --version 4.0.2-beta1
#r "nuget: Newtonsoft.Json.Schema, 4.0.2-beta1"
// Install Newtonsoft.Json.Schema as a Cake Addin #addin nuget:?package=Newtonsoft.Json.Schema&version=4.0.2-beta1&prerelease // Install Newtonsoft.Json.Schema as a Cake Tool #tool nuget:?package=Newtonsoft.Json.Schema&version=4.0.2-beta1&prerelease
Json.NET Schema
Json.NET Schema is a powerful, complete and easy to use JSON Schema framework for .NET
Validate JSON
JSchema schema = JSchema.Parse(@"{
'type': 'object',
'properties': {
'name': {'type':'string'},
'roles': {'type': 'array'}
}
}");
JObject user = JObject.Parse(@"{
'name': 'Arnie Admin',
'roles': ['Developer', 'Administrator']
}");
bool valid = user.IsValid(schema);
// true
Generate Schemas
JSchemaGenerator generator = new JSchemaGenerator();
JSchema schema = generator.Generate(typeof(Account));
// {
// "type": "object",
// "properties": {
// "email": { "type": "string", "format": "email" }
// },
// "required": [ "email" ]
// }
public class Account
{
[EmailAddress]
[JsonProperty("email", Required = Required.Always)]
public string Email;
}
Validate Deserialization
JSchema schema = JSchema.Parse(@"{
'type': 'array',
'item': {'type':'string'}
}");
JsonTextReader reader = new JsonTextReader(new StringReader(@"[
'Developer',
'Administrator'
]"));
JSchemaValidatingReader validatingReader = new JSchemaValidatingReader(reader);
validatingReader.Schema = schema;
JsonSerializer serializer = new JsonSerializer();
List<string> roles = serializer.Deserialize<List<string>>(validatingReader);
Links
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 3.5
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.0
- Newtonsoft.Json (>= 13.0.3)
-
.NETFramework 4.5
- Newtonsoft.Json (>= 13.0.3)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.3)
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (192)
Showing the top 5 NuGet packages that depend on Newtonsoft.Json.Schema:
Package | Downloads |
---|---|
RestAssured
Package Description |
|
Hochfrequenz.BO4Enet
Package Description |
|
CyberEye.Constant.Lib
Package chứa các constant và enum |
|
JUST.NETCore
This a cool library in .NET Core which enables you to transform a JSON document into another JSON document using JSON transformations using JSON path. This is the JSON equivalent of XSLT. Test project can be found at https://github.com/WorkMaze/JUST.net |
|
DotNetStac
Terradue .Net library for working with any SpatioTemporal Asset Catalog |
GitHub repositories (45)
Showing the top 5 popular GitHub repositories that depend on Newtonsoft.Json.Schema:
Repository | Stars |
---|---|
mRemoteNG/mRemoteNG
mRemoteNG is the next generation of mRemote, open source, tabbed, multi-protocol, remote connections manager.
|
|
btcpayserver/btcpayserver
Accept Bitcoin payments. Free, open-source & self-hosted, Bitcoin payment processor.
|
|
dotnet/corert
This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
|
|
OpenTabletDriver/OpenTabletDriver
Open source, cross-platform, user-mode tablet driver
|
|
Pathoschild/SMAPI
The modding API for Stardew Valley.
|
Version | Downloads | Last updated |
---|---|---|
4.0.2-beta1 | 622 | 9/16/2024 |
4.0.1 | 580,452 | 6/8/2024 |
3.0.16 | 362,800 | 5/6/2024 |
3.0.15 | 5,165,788 | 4/29/2023 |
3.0.14 | 17,034,725 | 2/21/2021 |
3.0.13 | 10,054,498 | 1/27/2020 |
3.0.12 | 8,771 | 1/27/2020 |
3.0.11 | 4,093,471 | 4/22/2019 |
3.0.10 | 11,772,956 | 3/23/2018 |
3.0.9 | 110,583 | 3/2/2018 |
3.0.8 | 23,548 | 3/2/2018 |
3.0.7 | 64,409 | 2/21/2018 |
3.0.6 | 51,658 | 2/17/2018 |
3.0.5 | 711,448 | 1/12/2018 |
3.0.4 | 323,767 | 9/28/2017 |
3.0.3 | 822,839 | 8/13/2017 |
3.0.2 | 455,380 | 7/7/2017 |
3.0.1 | 574,905 | 6/5/2017 |
2.0.13 | 221,420 | 5/28/2017 |
2.0.12 | 17,157 | 5/19/2017 |
2.0.11 | 106,224 | 4/12/2017 |
2.0.10 | 757,604 | 3/28/2017 |
2.0.9 | 30,917 | 3/21/2017 |
2.0.8 | 347,133 | 12/18/2016 |
2.0.7 | 207,381 | 10/16/2016 |
2.0.6 | 116,798 | 9/3/2016 |
2.0.5 | 14,073 | 8/26/2016 |
2.0.4 | 88,652 | 7/17/2016 |
2.0.3 | 27,531 | 7/5/2016 |
2.0.2 | 341,279 | 1/9/2016 |
2.0.1 | 16,332 | 12/29/2015 |
1.0.11 | 317,492 | 8/29/2015 |
1.0.10 | 7,219 | 8/16/2015 |
1.0.9 | 44,922 | 6/27/2015 |
1.0.8 | 135,374 | 2/25/2015 |
1.0.7 | 2,344 | 2/22/2015 |
1.0.6 | 2,298 | 2/15/2015 |
1.0.5 | 2,158 | 2/7/2015 |
1.0.4 | 23,051 | 1/29/2015 |
1.0.3 | 2,026 | 1/25/2015 |
1.0.2 | 2,125 | 1/23/2015 |
1.0.1 | 15,694 | 1/20/2015 |