Table of Contents

Class Extensions

Namespace
Newtonsoft.Json.Schema
Assembly
Newtonsoft.Json.dll

Contains the JSON schema extension methods.

public static class Extensions
Inheritance
Extensions
Inherited Members

Methods

IsValid(JToken, JsonSchema)

Determines whether the JToken is valid.

public static bool IsValid(this JToken source, JsonSchema schema)

Parameters

source JToken

The source JToken to test.

schema JsonSchema

The schema to test with.

Returns

bool

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

IsValid(JToken, JsonSchema, out IList<string>)

Determines whether the JToken is valid.

public static bool IsValid(this JToken source, JsonSchema schema, out IList<string> errorMessages)

Parameters

source JToken

The source JToken to test.

schema JsonSchema

The schema to test with.

errorMessages IList<string>

When this method returns, contains any error messages generated while validating.

Returns

bool

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

Validate(JToken, JsonSchema)

Validates the specified JToken.

public static void Validate(this JToken source, JsonSchema schema)

Parameters

source JToken

The source JToken to test.

schema JsonSchema

The schema to test with.

Validate(JToken, JsonSchema, ValidationEventHandler)

Validates the specified JToken.

public static void Validate(this JToken source, JsonSchema schema, ValidationEventHandler validationEventHandler)

Parameters

source JToken

The source JToken to test.

schema JsonSchema

The schema to test with.

validationEventHandler ValidationEventHandler

The validation event handler.