{"record":{"id":"4ad3f83549bb301d","repo":"diegosouzapw/OmniRoute","slug":"zip-archive-contains-no-json-files","errorCode":null,"errorMessage":"ZIP archive contains no .json files","messagePattern":"ZIP archive contains no \\.json files","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/utils/jsonZipExtract.ts","lineNumber":46,"sourceCode":"  zipBuffer: Buffer,\n  options: ExtractZipOptions = {}\n): ExtractedZipFile[] {\n  const maxFiles = options.maxFiles ?? DEFAULT_MAX_FILES;\n  const maxFileSize = options.maxFileSizeBytes ?? DEFAULT_MAX_FILE_SIZE;\n  const maxTotal = options.maxTotalSizeBytes ?? DEFAULT_MAX_TOTAL;\n\n  let unzipped: Unzipped;\n  try {\n    unzipped = unzipSync(new Uint8Array(zipBuffer));\n  } catch {\n    throw new Error(\"Could not parse ZIP archive — file may be corrupt or not a valid ZIP\");\n  }\n\n  const entries = Object.entries(unzipped).filter(([, data]) => data !== undefined);\n  const jsonEntries = entries.filter(([name]) => name.toLowerCase().endsWith(\".json\"));\n\n  if (jsonEntries.length === 0) {\n    throw new Error(\"ZIP archive contains no .json files\");\n  }\n\n  if (jsonEntries.length > maxFiles) {\n    throw new Error(\n      `ZIP archive contains ${jsonEntries.length} .json files — max allowed is ${maxFiles}`\n    );\n  }\n\n  let totalBytes = 0;\n  const result: ExtractedZipFile[] = [];\n\n  for (const [entryName, data] of jsonEntries) {\n    const baseName = path.basename(entryName);\n\n    if (!isSafeEntryName(baseName)) {\n      throw new Error(\n        `ZIP entry \"${baseName}\" has an unsafe filename (must be a .json file without path traversal)`\n      );","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/jsonZipExtract.ts#L28-L64","documentation":"Error \"ZIP archive contains no .json files\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/utils/jsonZipExtract.ts:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}