Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > JsonFile > loadAndValidateWithCallback

JsonFile.loadAndValidateWithCallback() method

Loads a JSON file and validate its schema, reporting errors using a callback

Signature:

static loadAndValidateWithCallback(jsonFilename: string, jsonSchema: JsonSchema, errorCallback: (errorInfo: IJsonSchemaErrorInfo) => void, options?: IJsonFileLoadAndValidateOptions): JsonObject;

Parameters

ParameterTypeDescription
jsonFilenamestring
jsonSchemaJsonSchema
errorCallback(errorInfo: IJsonSchemaErrorInfo) => void
optionsIJsonFileLoadAndValidateOptions(Optional)

Returns:

JsonObject

Remarks

See JsonSchema.validateObjectWithCallback() for more info.