{"record":{"id":"892f4816248af3e2","repo":"paperclipai/paperclip","slug":"path-is-required-and-must-be-a-non-empty-string","errorCode":null,"errorMessage":"\"path\" is required and must be a non-empty string","messagePattern":"\"path\" is required and must be a non-empty string","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/src/routes/plugins.ts","lineNumber":2901,"sourceCode":"  router.post(\"/plugins/:pluginId/companies/:companyId/local-folders/:folderKey/validate\", async (req, res) => {\n    assertBoardOrgAccess(req);\n    const { pluginId, companyId, folderKey } = req.params;\n    assertCompanyAccess(req, companyId);\n\n    const plugin = await resolvePlugin(registry, pluginId);\n    if (!plugin) {\n      res.status(404).json({ error: \"Plugin not found\" });\n      return;\n    }\n\n    const body = req.body as {\n      path?: unknown;\n      access?: \"read\" | \"readWrite\";\n      requiredDirectories?: string[];\n      requiredFiles?: string[];\n    } | undefined;\n    if (typeof body?.path !== \"string\" || body.path.trim().length === 0) {\n      res.status(400).json({ error: '\"path\" is required and must be a non-empty string' });\n      return;\n    }\n\n    const declaration = requireLocalFolderDeclaration(plugin.manifestJson.localFolders ?? [], folderKey);\n    const status = await inspectPluginLocalFolder({\n      folderKey,\n      declaration,\n      overrideConfig: {\n        path: body.path,\n      },\n    });\n    res.json(status);\n  });\n\n  router.put(\"/plugins/:pluginId/companies/:companyId/local-folders/:folderKey\", async (req, res) => {\n    assertBoardOrgAccess(req);\n    assertPluginManagementVisible();\n    const { pluginId, companyId, folderKey } = req.params;","sourceCodeStart":2883,"sourceCodeEnd":2919,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/routes/plugins.ts#L2883-L2919","documentation":"400 validation guard on POST .../local-folders/:folderKey/validate. Fires when req.body.path is missing, not a string, or an empty string; the folder validation endpoint requires a concrete path to probe against the declared folder contract.","triggerScenarios":"Thrown at server/src/routes/plugins.ts:2879 when the library encounters an invalid state.","commonSituations":"Validation error returned when a plugin file/path route is called without a valid \"path\" field in the request body.","solutions":["Provide a non-empty string \"path\" in the request body.","Ensure the JSON body is being sent with Content-Type: application/json so the path field is parsed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}