JsonSchema.Net 7.3.0

There is a newer version of this package available.
See the version list below for details.

Requires NuGet 2.12 or higher.

dotnet add package JsonSchema.Net --version 7.3.0                
NuGet\Install-Package JsonSchema.Net -Version 7.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JsonSchema.Net" Version="7.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JsonSchema.Net --version 7.3.0                
#r "nuget: JsonSchema.Net, 7.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JsonSchema.Net as a Cake Addin
#addin nuget:?package=JsonSchema.Net&version=7.3.0

// Install JsonSchema.Net as a Cake Tool
#tool nuget:?package=JsonSchema.Net&version=7.3.0                

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").

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 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (66)

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

Neuroglia.Serialization.YamlDotNet

Package Description

GitHub repositories (18)

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/yarp
A toolkit for developing high-performance HTTP reverse proxy applications.
dotnet/aspire
Tools, templates, and packages to accelerate building observable, production-ready apps
Version Downloads Last updated
7.3.3 68,273 2/10/2025
7.3.2 33,318 2/5/2025
7.3.1 213,655 12/28/2024
7.3.0 157,273 12/1/2024
7.2.3 627,825 9/20/2024
7.2.2 173,565 8/18/2024
7.2.1 2,373 8/16/2024
7.2.0 79,774 8/7/2024
7.1.2 366,491 7/2/2024
7.1.1 33,415 6/28/2024
7.1.0 18,475 6/25/2024
7.0.4 687,497 6/8/2024
7.0.3 35,007 6/3/2024
7.0.2 101,742 5/13/2024
7.0.1 37,099 5/7/2024
7.0.0.3 45,056 5/1/2024
6.1.2 112,577 4/22/2024
6.1.1 8,015 4/20/2024 6.1.1 is deprecated because it has critical bugs.
6.1.0.1 132,396 4/19/2024 6.1.0.1 is deprecated because it has critical bugs.
6.1.0 36,412 4/18/2024 6.1.0 is deprecated because it has critical bugs.
6.0.7 106,632 3/25/2024
6.0.6 2,804 3/24/2024
6.0.5 81,109 3/18/2024
6.0.4 99,762 3/3/2024
6.0.3 207,312 2/19/2024
6.0.2 28,260 2/7/2024
6.0.1 15,699 2/3/2024
6.0.0 67,760 2/3/2024
5.5.1 272,932 1/21/2024
5.5.0 168,653 1/8/2024
5.4.3 89,817 12/19/2023
5.4.2 1,073,939 12/5/2023
5.4.1 8,952 12/2/2023
5.4.0 94,851 11/21/2023
5.3.1 506,053 11/4/2023
5.3.0 20,458 10/30/2023
5.2.7 1,525,057 10/28/2023
5.2.6 254,753 10/1/2023
5.2.5 69,757 9/10/2023
5.2.4 769 9/10/2023
5.2.3 7,862 9/8/2023
5.2.2 436 9/7/2023
5.2.1 28,853 9/1/2023
5.2.0 33,326 8/22/2023
5.1.3 70,085 8/5/2023
5.1.0 2,205 8/4/2023
5.0.0 2,116 8/2/2023
4.1.8 131,045 7/21/2023
4.1.7 3,000 7/20/2023
4.1.6 261,725 7/3/2023
4.1.5 1,269,617 6/13/2023
4.1.4 488 6/13/2023
4.1.3 2,438 6/10/2023
4.1.2 7,281 6/7/2023
4.1.1 249,133 5/5/2023
4.1.0 53,997 4/30/2023
4.0.7 1,113 4/28/2023
4.0.6 17,428 4/23/2023
4.0.5 5,832 4/20/2023
4.0.4 55,904 4/19/2023
4.0.3 107,987 4/5/2023
4.0.2 22,132 3/29/2023
4.0.1 9,077 3/27/2023
4.0.0 95,218 3/19/2023
4.0.0-beta3 5,468 2/28/2023
4.0.0-beta2 8,006 12/14/2022
4.0.0-beta1a 674 12/1/2022
3.3.2 1,014,817 11/13/2022
3.3.1 2,179 11/11/2022
3.3.0 35,134 11/6/2022
3.2.1 248,075 9/4/2022
3.2.0 417,175 7/11/2022
3.1.5 5,542 7/11/2022
3.1.4 10,150 7/5/2022
3.1.3 539 7/5/2022
3.1.2 13,486 6/28/2022
3.1.1 20,863 6/16/2022
3.1.0 4,285 6/15/2022
3.0.0 7,561 6/13/2022
2.4.0 116,836 5/26/2022
2.3.0 97,712 4/4/2022
2.2.1 19,904 3/31/2022
2.2.0 54,573 3/24/2022
2.1.2 18,884 3/22/2022
2.1.1 22,272 2/25/2022
2.1.0 5,733 2/23/2022
2.0.3 13,049 2/12/2022
2.0.2 14,074 2/9/2022
2.0.1 54,306 1/28/2022
2.0.0 74,341 1/13/2022
1.13.0 18,462 1/12/2022
1.12.0 50,394 12/5/2021
1.11.6 16,383 11/29/2021
1.11.5 44,919 11/11/2021
1.11.4 8,577 11/5/2021
1.11.3 131,587 9/22/2021
1.11.2 85,673 9/5/2021
1.11.1 508 9/5/2021
1.11.0 494 9/4/2021
1.10.8 17,350 8/27/2021
1.10.7 138,623 7/13/2021
1.10.6 17,632 7/2/2021
1.10.5 1,826 6/29/2021
1.10.4 24,069 6/20/2021
1.10.3 31,235 6/5/2021
1.10.2 45,451 4/17/2021
1.10.1 969 4/14/2021
1.10.0 1,759 4/10/2021
1.9.4 5,877 4/3/2021
1.9.3 30,912 3/5/2021
1.9.2 544 3/3/2021
1.9.1 24,569 2/24/2021
1.9.0 972 2/24/2021
1.8.0 7,789 2/3/2021
1.7.1 6,297 1/21/2021
1.7.0 1,890 1/17/2021
1.6.1 3,238 1/1/2021
1.6.0 7,629 12/14/2020
1.5.4 5,368 11/28/2020
1.5.3 2,727 11/26/2020
1.5.2 937 11/22/2020
1.5.1 2,077 11/3/2020
1.5.0 681 11/1/2020
1.4.0 582 10/30/2020
1.3.1 651 10/22/2020
1.3.0 1,001 10/17/2020
1.2.0 2,741 10/9/2020
1.1.0 830 10/5/2020
1.0.3 596 9/29/2020
1.0.2 1,808 9/1/2020
1.0.1 628 9/1/2020
1.0.0 6,084 8/29/2020
1.0.0-rc2 414 8/29/2020
1.0.0-rc1 377 8/28/2020

Release notes can be found at https://json-everything.net/json-schema