{"record":{"id":"d09284b779d3b4e1","repo":"diegosouzapw/OmniRoute","slug":"provider-validation-failed-for-name","errorCode":null,"errorMessage":"Provider validation failed for ${name}","messagePattern":"Provider validation failed for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/validation/providerSchema.ts","lineNumber":52,"sourceCode":"  serviceKinds: z.array(z.enum(SERVICE_KIND_VALUES)).optional(),\n  noAuth: z.boolean().optional(),\n  anonymousFallback: z.boolean().optional(),\n  managedAccount: z.boolean().optional(),\n});\n\nexport const ProvidersMapSchema = z.record(z.string(), ProviderSchema);\n\n/**\n * Validate a providers map, throwing a descriptive error on failure.\n * @param {Record<string, object>} map - The providers map to validate\n * @param {string} name - Name of the map for error messages\n */\nexport function validateProviders(map: Record<string, unknown>, name: string): void {\n  const result = ProvidersMapSchema.safeParse(map);\n  if (!result.success) {\n    const issues = result.error.issues.map((i) => `  ${i.path.join(\".\")}: ${i.message}`).join(\"\\n\");\n    console.error(`[PROVIDER VALIDATION] ${name} has invalid entries:\\n${issues}`);\n    throw new Error(`Provider validation failed for ${name}`);\n  }\n}\n","sourceCodeStart":34,"sourceCodeEnd":55,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/validation/providerSchema.ts#L34-L55","documentation":"Aggregated validation error from validateProviders(): the providers map failed the ProvidersMapSchema Zod check, and the thrown message wraps the provider-map name plus the Zod issue list. It fires at provider-registry load time when a provider definition in providers.ts (or a user-supplied map) violates the schema (bad type, missing required field, invalid enum).","triggerScenarios":"Thrown at src/shared/validation/providerSchema.ts:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped Zod issues to find the exact provider and offending field","Fix the provider definition to satisfy ProviderSchema (fields, enums like serviceKinds, types)","Validate user/custom provider maps with safeParse before passing them in","Keep the schema and providers.ts in sync when adding new provider fields"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}