{"record":{"id":"8c930f49c521d672","repo":"usebruno/bruno","slug":"api-spec-apispecname-is-not-a-valid-filename","errorCode":null,"errorMessage":"api spec: ${apiSpecName} is not a valid filename","messagePattern":"api spec: (.+?) is not a valid filename","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/apiSpec.js","lineNumber":36,"sourceCode":"\n  ipcMain.handle('renderer:open-api-spec-file', (event, apiSpecPath, workspacePath = null) => {\n    if (watcher && mainWindow) {\n      openApiSpec(mainWindow, watcher, apiSpecPath, { workspacePath });\n    }\n  });\n\n  ipcMain.handle('renderer:save-api-spec', async (event, pathname, content) => {\n    try {\n      await writeFile(pathname, content);\n    } catch (error) {\n      return Promise.reject(error);\n    }\n  });\n\n  ipcMain.handle('renderer:create-api-spec', async (event, apiSpecName, apiSpecLocation, content = '', workspacePath = null) => {\n    try {\n      if (typeof apiSpecName !== 'string' || apiSpecName !== path.basename(apiSpecName)) {\n        throw new Error(`api spec: ${apiSpecName} is not a valid filename`);\n      }\n      validateApiSpec(apiSpecName);\n\n      if (typeof apiSpecLocation !== 'string' || !isDirectory(apiSpecLocation)) {\n        throw new Error(`path: ${apiSpecLocation} is not an existing directory`);\n      }\n\n      let pathname = path.join(apiSpecLocation, apiSpecName);\n      if (fs.existsSync(pathname)) {\n        throw new Error(`path: ${pathname} already exists`);\n      }\n      await writeFile(pathname, content);\n      openApiSpec(mainWindow, watcher, pathname, { workspacePath });\n    } catch (error) {\n      return Promise.reject(error);\n    }\n  });\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/apiSpec.js#L18-L54","documentation":"Error \"api spec: ${apiSpecName} is not a valid filename\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/apiSpec.js:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the API spec using only valid filename characters (no path separators or reserved names)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}