Newtonsoft.Json.Schema 4.0.2-beta2

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);

Showing the top 20 packages that depend on Newtonsoft.Json.Schema.

Packages Downloads
Microsoft.Bot.Builder
Microsoft Bot Builder is a powerful framework for constructing bots that can handle both freeform interactions and more guided ones where the possibilities are explicitly shown to the user. It is easy to use and leverages C# to provide a natural way to write bots. High Level Features: * Powerful dialog system with dialogs that are isolated and composable. * Built-in dialogs for simple things like Yes/No, strings, numbers, enumerations. * Built-in dialogs that utilize powerful AI frameworks like LUIS http://luis.ai. * Bots are stateless which helps them scale. * Form Flow for automatically generating a Bot from a C# class for filling in the class and that supports help, navigation, clarification and confirmation. See http://docs.botframework.com/sdkreference/csharp/ for documentation.
11
Microsoft.Bot.Builder
Microsoft Bot Builder is a powerful framework for constructing bots that can handle both freeform interactions and more guided ones where the possibilities are explicitly shown to the user. It is easy to use and leverages C# to provide a natural way to write bots. High Level Features: * Powerful dialog system with dialogs that are isolated and composable. * Built-in dialogs for simple things like Yes/No, strings, numbers, enumerations. * Built-in dialogs that utilize powerful AI frameworks like LUIS http://luis.ai. * Bots are stateless which helps them scale. * Form Flow for automatically generating a Bot from a C# class for filling in the class and that supports help, navigation, clarification and confirmation. See http://docs.botframework.com/sdkreference/csharp/ for documentation.
12

.NET Framework 3.5

.NET Framework 4.0

.NET Framework 4.5

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
4.0.2-beta2 13 03/27/2025
4.0.2-beta1 11 03/27/2025
4.0.1 11 03/27/2025
3.0.16 11 03/27/2025
3.0.15 10 03/27/2025
3.0.14 10 03/27/2025
3.0.13 10 03/27/2025
3.0.12 11 03/27/2025
3.0.11 11 03/27/2025
3.0.10 10 03/27/2025
3.0.9 10 03/27/2025
3.0.8 12 03/27/2025
3.0.7 12 03/27/2025
3.0.6 11 03/27/2025
3.0.5 12 03/27/2025
3.0.4 12 03/27/2025
3.0.3 12 03/27/2025
3.0.2 11 03/27/2025
3.0.1 12 03/27/2025
2.0.13 10 03/27/2025
2.0.12 10 03/27/2025
2.0.11 11 03/27/2025
2.0.10 10 03/27/2025
2.0.9 12 03/27/2025
2.0.8 11 03/27/2025
2.0.7 12 03/27/2025
2.0.6 11 03/27/2025
2.0.5 13 03/27/2025
2.0.4 11 03/27/2025
2.0.3 11 03/27/2025
2.0.2 11 03/27/2025
2.0.1 11 03/27/2025
1.0.11 11 03/27/2025
1.0.10 11 03/27/2025
1.0.9 11 03/27/2025
1.0.8 13 03/27/2025
1.0.7 13 03/27/2025
1.0.6 12 03/27/2025
1.0.5 11 03/27/2025
1.0.4 12 03/27/2025
1.0.3 11 03/27/2025
1.0.2 10 03/27/2025
1.0.1 11 03/27/2025