JsonSchema.Net 6.1.0.1

Requires NuGet 2.12 or higher.

dotnet add package JsonSchema.Net --version 6.1.0.1
NuGet\Install-Package JsonSchema.Net -Version 6.1.0.1
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="6.1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JsonSchema.Net --version 6.1.0.1
#r "nuget: JsonSchema.Net, 6.1.0.1"
#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=6.1.0.1

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

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);
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. 
.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 (61)

Showing the top 5 NuGet packages that depend on JsonSchema.Net:

Package Downloads
Microsoft.PowerShell.Commands.Utility The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Runtime for hosting PowerShell

JsonSchema.Net.Generation

Extends JsonSchema.Net to provide schema generation functionality

Qart.Testing

Package Description

CycloneDX.Core

A .NET Standard library for CycloneDX bill-of-material documents.

Microsoft.DocAsCode.Build.SchemaDriven The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Package Description

GitHub repositories (6)

Showing the top 5 popular GitHub repositories that depend on JsonSchema.Net:

Repository Stars
PowerShell/PowerShell
PowerShell for every system!
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
dotnet/crank
Benchmarking infrastructure for applications
microsoft/teams-ai
SDK focused on building AI based applications and extensions for Microsoft Teams.
Version Downloads Last updated
6.1.0.1 0 4/19/2024
6.1.0 332 4/18/2024
6.0.7 14,647 3/25/2024
6.0.6 1,388 3/24/2024
6.0.5 12,626 3/18/2024
6.0.4 26,725 3/3/2024
6.0.3 50,733 2/19/2024
6.0.2 17,397 2/7/2024
6.0.1 9,867 2/3/2024
6.0.0 13,009 2/3/2024
5.5.1 84,341 1/21/2024
5.5.0 62,087 1/8/2024
5.4.3 41,894 12/19/2023
5.4.2 337,291 12/5/2023
5.4.1 6,154 12/2/2023
5.4.0 51,280 11/21/2023
5.3.1 217,932 11/4/2023
5.3.0 9,518 10/30/2023
5.2.7 200,003 10/28/2023
5.2.6 137,672 10/1/2023
5.2.5 53,701 9/10/2023
5.2.4 712 9/10/2023
5.2.3 1,539 9/8/2023
5.2.2 374 9/7/2023
5.2.1 27,707 9/1/2023
5.2.0 19,661 8/22/2023
5.1.3 50,496 8/5/2023
5.1.0 1,517 8/4/2023
5.0.0 1,074 8/2/2023
4.1.8 106,215 7/21/2023
4.1.7 2,742 7/20/2023
4.1.6 152,144 7/3/2023
4.1.5 401,227 6/13/2023
4.1.4 362 6/13/2023
4.1.3 2,228 6/10/2023
4.1.2 4,875 6/7/2023
4.1.1 170,435 5/5/2023
4.1.0 27,883 4/30/2023
4.0.7 870 4/28/2023
4.0.6 14,337 4/23/2023
4.0.5 5,506 4/20/2023
4.0.4 26,454 4/19/2023
4.0.3 72,275 4/5/2023
4.0.2 16,379 3/29/2023
4.0.1 8,202 3/27/2023
4.0.0 62,098 3/19/2023
4.0.0-beta3 5,332 2/28/2023
4.0.0-beta2 7,742 12/14/2022
4.0.0-beta1a 631 12/1/2022
3.3.2 628,550 11/13/2022
3.3.1 1,827 11/11/2022
3.3.0 34,317 11/6/2022
3.2.1 205,073 9/4/2022
3.2.0 311,526 7/11/2022
3.1.5 3,582 7/11/2022
3.1.4 6,537 7/5/2022
3.1.3 485 7/5/2022
3.1.2 10,680 6/28/2022
3.1.1 17,628 6/16/2022
3.1.0 3,309 6/15/2022
3.0.0 7,076 6/13/2022
2.4.0 100,656 5/26/2022
2.3.0 94,703 4/4/2022
2.2.1 15,588 3/31/2022
2.2.0 40,280 3/24/2022
2.1.2 18,485 3/22/2022
2.1.1 19,564 2/25/2022
2.1.0 5,068 2/23/2022
2.0.3 11,479 2/12/2022
2.0.2 11,605 2/9/2022
2.0.1 46,558 1/28/2022
2.0.0 45,394 1/13/2022
1.13.0 18,208 1/12/2022
1.12.0 48,976 12/5/2021
1.11.6 15,496 11/29/2021
1.11.5 25,919 11/11/2021
1.11.4 3,779 11/5/2021
1.11.3 127,506 9/22/2021
1.11.2 69,774 9/5/2021
1.11.1 457 9/5/2021
1.11.0 432 9/4/2021
1.10.8 13,547 8/27/2021
1.10.7 112,068 7/13/2021
1.10.6 16,025 7/2/2021
1.10.5 1,706 6/29/2021
1.10.4 17,183 6/20/2021
1.10.3 28,713 6/5/2021
1.10.2 38,953 4/17/2021
1.10.1 893 4/14/2021
1.10.0 1,701 4/10/2021
1.9.4 5,745 4/3/2021
1.9.3 30,138 3/5/2021
1.9.2 490 3/3/2021
1.9.1 21,998 2/24/2021
1.9.0 849 2/24/2021
1.8.0 7,547 2/3/2021
1.7.1 4,963 1/21/2021
1.7.0 1,771 1/17/2021
1.6.1 2,623 1/1/2021
1.6.0 7,545 12/14/2020
1.5.4 5,267 11/28/2020
1.5.3 1,861 11/26/2020
1.5.2 878 11/22/2020
1.5.1 2,030 11/3/2020
1.5.0 618 11/1/2020
1.4.0 526 10/30/2020
1.3.1 596 10/22/2020
1.3.0 936 10/17/2020
1.2.0 1,774 10/9/2020
1.1.0 597 10/5/2020
1.0.3 533 9/29/2020
1.0.2 1,717 9/1/2020
1.0.1 546 9/1/2020
1.0.0 1,675 8/29/2020
1.0.0-rc2 340 8/29/2020
1.0.0-rc1 331 8/28/2020

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