Skip to main content
.NETFramework3.5.NETFramework4.0.NETFramework4.5.NETStandard2.0.NETStandard2.1

Json.NET Schema is a complete and easy-to-use JSON Schema framework for .NET

Published
Sep 21, 2026
29d ago
Total Downloads
97.6M
97,583,772

Install

dotnet add package Newtonsoft.Json.Schema --version 4.0.2-beta3
ProductVersions
.NET Standard
netstandard2.0netstandard2.1
Other
.NETFramework3.5.NETFramework4.0.NETFramework4.5

README

Logo Json.NET Schema

NuGet version (Newtonsoft.Json.Schema) Build status

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

Changes from Previous Version

No structural changes between v4.0.2-beta2 and v4.0.2-beta3.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.