Skip to main content

ContentValidationError

The error thrown when final JSON syntax or matching document schemas fail.

Import​

import { ContentValidationError } from '@bedrock-core/builder/validation';

Members​

MemberTypeDescription
diagnosticsreadonly ContentDiagnostic[]Structured failures collected across checked files
namestringContentValidationError
messagestringFormatted pack/file/pointer diagnostics

Each diagnostic carries pack, a pack-relative file path, JSON pointer and message. A syntax error can use an empty pointer and report an offset instead.

Usage​

import { ContentValidationError, validatePackContent } from '@bedrock-core/builder/validation';

try {
await validatePackContent({
packs: [{ id: 'assets', path: './build/RP', kind: 'resource' }],
});
} catch (error) {
if (error instanceof ContentValidationError) {
for (const issue of error.diagnostics) console.warn(issue);
}
throw error;
}

Notes​

Unavailable upstream schemas appear in validation coverage. JSON syntax/schema checks do not prove assets, Molang, UI bindings or in-game behavior.