{"record":{"id":"4f2c37beed8c90ae","repo":"JuliusBrussee/caveman","slug":"no-json-schemas-found","errorCode":null,"errorMessage":"no JSON schemas found","messagePattern":"no JSON schemas found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/shared/contracts/scripts/validate-schemas.mjs","lineNumber":13,"sourceCode":"import { readdir, readFile } from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport path from \"node:path\";\nimport Ajv2020 from \"ajv/dist/2020.js\";\n\nconst packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), \"..\");\nconst schemaRoot = path.join(packageRoot, \"schemas\");\nconst files = (await readdir(schemaRoot))\n  .filter((name) => name.endsWith(\".schema.json\"))\n  .sort();\n\nif (files.length === 0) {\n  throw new Error(\"no JSON schemas found\");\n}\n\nconst schemas = [];\nfor (const file of files) {\n  const schema = JSON.parse(await readFile(path.join(schemaRoot, file), \"utf8\"));\n  if (schema.$schema !== \"https://json-schema.org/draft/2020-12/schema\") {\n    throw new Error(`${file}: unsupported or missing $schema`);\n  }\n  if (typeof schema.$id !== \"string\" || schema.$id.length === 0) {\n    throw new Error(`${file}: missing $id`);\n  }\n  schemas.push(schema);\n}\n\nconst ajv = new Ajv2020({ allErrors: true, strict: true });\najv.addSchema(schemas);\nfor (const schema of schemas) {\n  const validate = ajv.getSchema(schema.$id);","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/packages/shared/contracts/scripts/validate-schemas.mjs#L1-L31","documentation":"Error \"no JSON schemas found\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at packages/shared/contracts/scripts/validate-schemas.mjs:13 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add JSON schema files to the contracts directory before validating."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}