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
sourceJTokenThe source JToken to test.
schemaJsonSchemaThe schema to test with.
Returns
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
sourceJTokenThe source JToken to test.
schemaJsonSchemaThe schema to test with.
errorMessagesIList<string>When this method returns, contains any error messages generated while validating.
Returns
Validate(JToken, JsonSchema)
Validates the specified JToken.
public static void Validate(this JToken source, JsonSchema schema)
Parameters
sourceJTokenThe source JToken to test.
schemaJsonSchemaThe schema to test with.
Validate(JToken, JsonSchema, ValidationEventHandler)
Validates the specified JToken.
public static void Validate(this JToken source, JsonSchema schema, ValidationEventHandler validationEventHandler)
Parameters
sourceJTokenThe source JToken to test.
schemaJsonSchemaThe schema to test with.
validationEventHandlerValidationEventHandlerThe validation event handler.