{"record":{"id":"75e937e452337db6","repo":"Foundry376/Mailspring","slug":"validation-failed-at-keypath-json-stringify-75e937","errorCode":null,"errorMessage":"Validation failed at ${keyPath}, ${JSON.stringify(value)} is not one of ${JSON.stringify(possibleValues)}","messagePattern":"Validation failed at (.+?), (.+?) is not one of (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/src/config.ts","lineNumber":921,"sourceCode":"        value = Math.min(value, schema.maximum);\n      }\n      return value;\n    },\n\n    validateEnum(keyPath, value, schema) {\n      const possibleValues = schema.enum;\n      if (possibleValues == null || !Array.isArray(possibleValues) || !possibleValues.length) {\n        return value;\n      }\n\n      for (const possibleValue of possibleValues) {\n        // Using `isEqual` for possibility of placing enums on array and object schemas\n        if (_.isEqual(possibleValue, value)) {\n          return value;\n        }\n      }\n\n      throw new Error(\n        `Validation failed at ${keyPath}, ${JSON.stringify(value)} is not one of ${JSON.stringify(\n          possibleValues\n        )}`\n      );\n    },\n  },\n});\n\nfunction isPlainObject(value) {\n  return _.isObject(value) && !_.isArray(value) && !_.isFunction(value) && !_.isString(value);\n}\n\nfunction splitKeyPath(keyPath) {\n  if (keyPath == null) {\n    return [];\n  }\n  let startIndex = 0;\n  const keyPathArray = [];","sourceCodeStart":903,"sourceCodeEnd":939,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/config.ts#L903-L939","documentation":"Config schema enum validator: the schema for keyPath declares an enum list, and the value deep-compares (_.isEqual) equal to none of the allowed entries. Common for locale, theme, or layout keys whose accepted values are fixed; the offending value and full allowed list are printed.","triggerScenarios":"Thrown at app/src/config.ts:921 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the key to one of the values listed in the error message","Update the plugin/package that wrote an outdated enum value after the allowed set changed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}