Click or drag to resize
Json.NET

ExtensionsValidate Method (JToken, JsonSchema, ValidationEventHandler)

 

Note: This API is now obsolete.

Validates the specified JToken.

Caution note Caution
JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details.

Namespace:  Newtonsoft.Json.Schema
Assembly:  Newtonsoft.Json (in Newtonsoft.Json.dll) Version: 12.0.1+509643a8952ce731e0207710c429ad6e67dc43db
Syntax
C#
[ObsoleteAttribute("JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details.")]
public static void Validate(
	this JToken source,
	JsonSchema schema,
	ValidationEventHandler validationEventHandler
)

Parameters

source
Type: Newtonsoft.Json.LinqJToken
The source JToken to test.
schema
Type: Newtonsoft.Json.SchemaJsonSchema
The schema to test with.
validationEventHandler
Type: Newtonsoft.Json.SchemaValidationEventHandler
The validation event handler.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type JToken. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also