Click or drag to resize
Json.NET Schema

SchemaExtensionsIsValid Method (JToken, JSchema, IListString)

Determines whether the JToken is valid.

Namespace:  Newtonsoft.Json.Schema
Assembly:  Newtonsoft.Json.Schema (in Newtonsoft.Json.Schema.dll) Version: 3.0.6
public static bool IsValid(
	this JToken source,
	JSchema schema,
	out IList<string> errorMessages


Type: Newtonsoft.Json.LinqJToken
The source JToken to test.
Type: Newtonsoft.Json.SchemaJSchema
The schema to test with.
Type: System.Collections.GenericIListString
When this method returns, contains any error messages generated while validating.

Return Value

Type: Boolean
true if the specified JToken is valid; otherwise, false.

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