JsonSchema.Net
7.2.2
Requires NuGet 2.12 or higher.
dotnet add package JsonSchema.Net --version 7.2.2
NuGet\Install-Package JsonSchema.Net -Version 7.2.2
<PackageReference Include="JsonSchema.Net" Version="7.2.2" />
paket add JsonSchema.Net --version 7.2.2
#r "nuget: JsonSchema.Net, 7.2.2"
// Install JsonSchema.Net as a Cake Addin #addin nuget:?package=JsonSchema.Net&version=7.2.2 // Install JsonSchema.Net as a Cake Tool #tool nuget:?package=JsonSchema.Net&version=7.2.2
Summary
JsonSchema.Net fully implements the JSON Schema specifications, a declarative syntax for validation and annotating JSON data.
Supported specifications:
- Draft 6 -
http://json-schema.org/draft-06/schema#
- Draft 7 -
http://json-schema.org/draft-07/schema#
- Draft 2019-09 -
https://json-schema.org/draft/2019-09/schema
- Draft 2020-12 -
https://json-schema.org/draft/2020-12/schema
This project also operates as a test bed for features proposed for the next version ("draft/next").
Links
Usage
Parse a schema:
var schema = JsonSchema.FromText(content);
Load one from a file:
var schema = JsonSchema.FromFile(filename);
Directly deserialize it:
var schema = JsonSerializer.Deserialize<JsonSchema>(content);
Or build it explicitly in code:
var schema = new JsonSchemaBuilder()
.Comment("a comment")
.Title("A title for my schema")
.Type(SchemaValueType.Object)
.Properties(
("foo", new JsonSchemaBuilder()
.Type(SchemaValueType.String)
),
("bar", new JsonSchemaBuilder()
.Type(SchemaValueType.Number)
)
)
.Build();
Use the schema to evaluate and annotate data:
var instance = JsonNode.Parse("{\"foo\":\"a value\",\"bar\":42}");
var results = schema.Evaluate(instance);
Sponsorship
If you found this library helpful and would like to promote continued development, please consider sponsoring the maintainers.
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 is compatible. 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 was computed. |
.NET Framework | 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. |
-
- JsonPointer.Net (>= 5.0.0)
NuGet packages (68)
Showing the top 5 NuGet packages that depend on JsonSchema.Net:
Package | Downloads |
---|---|
Microsoft.PowerShell.Commands.Utility
Runtime for hosting PowerShell |
|
JsonSchema.Net.Generation
Extends JsonSchema.Net to provide schema generation functionality |
|
CycloneDX.Core
A .NET Standard library for CycloneDX bill-of-material documents. |
|
Qart.Testing
Package Description |
|
Microsoft.DocAsCode.Build.SchemaDriven
Package Description |
GitHub repositories (13)
Showing the top 5 popular GitHub repositories that depend on JsonSchema.Net:
Repository | Stars |
---|---|
PowerShell/PowerShell
PowerShell for every system!
|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
dotnet/runtime
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
|
|
dotnet/docfx
Static site generator for .NET API documentation.
|
|
dotnet/aspire
An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
|
Version | Downloads | Last updated | |
---|---|---|---|
7.2.2 | 40,328 | 8/18/2024 | |
7.2.1 | 1,312 | 8/16/2024 | |
7.2.0 | 33,248 | 8/7/2024 | |
7.1.2 | 116,687 | 7/2/2024 | |
7.1.1 | 16,111 | 6/28/2024 | |
7.1.0 | 12,764 | 6/25/2024 | |
7.0.4 | 90,156 | 6/8/2024 | |
7.0.3 | 19,834 | 6/3/2024 | |
7.0.2 | 78,330 | 5/13/2024 | |
7.0.1 | 21,846 | 5/7/2024 | |
7.0.0.3 | 27,151 | 5/1/2024 | |
6.1.2 | 53,130 | 4/22/2024 | |
6.1.1 | 5,987 | 4/20/2024 | |
6.1.0.1 | 63,187 | 4/19/2024 | |
6.1.0 | 19,104 | 4/18/2024 | |
6.0.7 | 79,850 | 3/25/2024 | |
6.0.6 | 2,372 | 3/24/2024 | |
6.0.5 | 58,066 | 3/18/2024 | |
6.0.4 | 61,154 | 3/3/2024 | |
6.0.3 | 147,655 | 2/19/2024 | |
6.0.2 | 23,887 | 2/7/2024 | |
6.0.1 | 12,562 | 2/3/2024 | |
6.0.0 | 46,555 | 2/3/2024 | |
5.5.1 | 168,391 | 1/21/2024 | |
5.5.0 | 114,882 | 1/8/2024 | |
5.4.3 | 66,545 | 12/19/2023 | |
5.4.2 | 743,487 | 12/5/2023 | |
5.4.1 | 7,431 | 12/2/2023 | |
5.4.0 | 74,731 | 11/21/2023 | |
5.3.1 | 319,795 | 11/4/2023 | |
5.3.0 | 14,867 | 10/30/2023 | |
5.2.7 | 745,537 | 10/28/2023 | |
5.2.6 | 199,895 | 10/1/2023 | |
5.2.5 | 63,444 | 9/10/2023 | |
5.2.4 | 735 | 9/10/2023 | |
5.2.3 | 2,738 | 9/8/2023 | |
5.2.2 | 397 | 9/7/2023 | |
5.2.1 | 28,568 | 9/1/2023 | |
5.2.0 | 26,709 | 8/22/2023 | |
5.1.3 | 64,315 | 8/5/2023 | |
5.1.0 | 2,141 | 8/4/2023 | |
5.0.0 | 1,397 | 8/2/2023 | |
4.1.8 | 118,657 | 7/21/2023 | |
4.1.7 | 2,864 | 7/20/2023 | |
4.1.6 | 214,247 | 7/3/2023 | |
4.1.5 | 753,279 | 6/13/2023 | |
4.1.4 | 374 | 6/13/2023 | |
4.1.3 | 2,289 | 6/10/2023 | |
4.1.2 | 6,447 | 6/7/2023 | |
4.1.1 | 203,639 | 5/5/2023 | |
4.1.0 | 39,326 | 4/30/2023 | |
4.0.7 | 937 | 4/28/2023 | |
4.0.6 | 16,533 | 4/23/2023 | |
4.0.5 | 5,675 | 4/20/2023 | |
4.0.4 | 40,913 | 4/19/2023 | |
4.0.3 | 88,059 | 4/5/2023 | |
4.0.2 | 19,075 | 3/29/2023 | |
4.0.1 | 8,618 | 3/27/2023 | |
4.0.0 | 76,277 | 3/19/2023 | |
4.0.0-beta3 | 5,359 | 2/28/2023 | |
4.0.0-beta2 | 7,895 | 12/14/2022 | |
4.0.0-beta1a | 636 | 12/1/2022 | |
3.3.2 | 846,950 | 11/13/2022 | |
3.3.1 | 2,068 | 11/11/2022 | |
3.3.0 | 34,678 | 11/6/2022 | |
3.2.1 | 225,408 | 9/4/2022 | |
3.2.0 | 369,342 | 7/11/2022 | |
3.1.5 | 4,629 | 7/11/2022 | |
3.1.4 | 9,812 | 7/5/2022 | |
3.1.3 | 493 | 7/5/2022 | |
3.1.2 | 12,709 | 6/28/2022 | |
3.1.1 | 19,069 | 6/16/2022 | |
3.1.0 | 3,514 | 6/15/2022 | |
3.0.0 | 7,282 | 6/13/2022 | |
2.4.0 | 107,748 | 5/26/2022 | |
2.3.0 | 95,875 | 4/4/2022 | |
2.2.1 | 18,449 | 3/31/2022 | |
2.2.0 | 44,726 | 3/24/2022 | |
2.1.2 | 18,677 | 3/22/2022 | |
2.1.1 | 20,461 | 2/25/2022 | |
2.1.0 | 5,527 | 2/23/2022 | |
2.0.3 | 12,174 | 2/12/2022 | |
2.0.2 | 13,030 | 2/9/2022 | |
2.0.1 | 49,958 | 1/28/2022 | |
2.0.0 | 57,269 | 1/13/2022 | |
1.13.0 | 18,282 | 1/12/2022 | |
1.12.0 | 49,511 | 12/5/2021 | |
1.11.6 | 15,946 | 11/29/2021 | |
1.11.5 | 35,857 | 11/11/2021 | |
1.11.4 | 6,018 | 11/5/2021 | |
1.11.3 | 129,418 | 9/22/2021 | |
1.11.2 | 85,276 | 9/5/2021 | |
1.11.1 | 463 | 9/5/2021 | |
1.11.0 | 444 | 9/4/2021 | |
1.10.8 | 15,208 | 8/27/2021 | |
1.10.7 | 125,623 | 7/13/2021 | |
1.10.6 | 16,444 | 7/2/2021 | |
1.10.5 | 1,715 | 6/29/2021 | |
1.10.4 | 20,524 | 6/20/2021 | |
1.10.3 | 29,844 | 6/5/2021 | |
1.10.2 | 42,136 | 4/17/2021 | |
1.10.1 | 903 | 4/14/2021 | |
1.10.0 | 1,713 | 4/10/2021 | |
1.9.4 | 5,790 | 4/3/2021 | |
1.9.3 | 30,743 | 3/5/2021 | |
1.9.2 | 497 | 3/3/2021 | |
1.9.1 | 23,485 | 2/24/2021 | |
1.9.0 | 856 | 2/24/2021 | |
1.8.0 | 7,576 | 2/3/2021 | |
1.7.1 | 5,241 | 1/21/2021 | |
1.7.0 | 1,807 | 1/17/2021 | |
1.6.1 | 2,768 | 1/1/2021 | |
1.6.0 | 7,553 | 12/14/2020 | |
1.5.4 | 5,282 | 11/28/2020 | |
1.5.3 | 2,384 | 11/26/2020 | |
1.5.2 | 888 | 11/22/2020 | |
1.5.1 | 2,043 | 11/3/2020 | |
1.5.0 | 626 | 11/1/2020 | |
1.4.0 | 535 | 10/30/2020 | |
1.3.1 | 604 | 10/22/2020 | |
1.3.0 | 954 | 10/17/2020 | |
1.2.0 | 2,136 | 10/9/2020 | |
1.1.0 | 716 | 10/5/2020 | |
1.0.3 | 544 | 9/29/2020 | |
1.0.2 | 1,760 | 9/1/2020 | |
1.0.1 | 552 | 9/1/2020 | |
1.0.0 | 3,603 | 8/29/2020 | |
1.0.0-rc2 | 345 | 8/29/2020 | |
1.0.0-rc1 | 335 | 8/28/2020 |
Release notes can be found at https://json-everything.net/json-schema