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
JTokenThe source JToken to test.
schema
JsonSchemaThe 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
source
JTokenThe source JToken to test.
schema
JsonSchemaThe schema to test with.
errorMessages
IList<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
source
JTokenThe source JToken to test.
schema
JsonSchemaThe 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
JTokenThe source JToken to test.
schema
JsonSchemaThe schema to test with.
validationEventHandler
ValidationEventHandlerThe validation event handler.