Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > JsonSchema > validateObject

JsonSchema.validateObject() method

Validates the specified JSON object against this JSON schema. If the validation fails, an exception will be thrown.

Signature:

validateObject(jsonObject: JsonObject, filenameForErrors: string, options?: IJsonSchemaValidateOptions): void;

Parameters

ParameterTypeDescription
jsonObjectJsonObjectThe JSON data to be validated
filenameForErrorsstringThe filename that the JSON data was available, or an empty string if not applicable
optionsIJsonSchemaValidateOptions(Optional) Other options that control the validation

Returns:

void