{"record":{"id":"a6772a0efa4f6cd9","repo":"JuliusBrussee/caveman","slug":"cachebench-invalid-array-close","errorCode":null,"errorMessage":"cachebench: invalid array close","messagePattern":"cachebench: invalid array close","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/strictjson.go","lineNumber":82,"sourceCode":"\t\t\t}\n\t\t}\n\t\tclosing, err := decoder.Token()\n\t\tif err != nil || closing != json.Delim('}') {\n\t\t\treturn errors.New(\"cachebench: invalid object close\")\n\t\t}\n\t\treturn nil\n\tcase '[':\n\t\tif root {\n\t\t\treturn errors.New(\"cachebench: JSON root must be object\")\n\t\t}\n\t\tfor decoder.More() {\n\t\t\tif err := validateUniqueJSONValue(decoder, false, depth+1); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tclosing, err := decoder.Token()\n\t\tif err != nil || closing != json.Delim(']') {\n\t\t\treturn errors.New(\"cachebench: invalid array close\")\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn errors.New(\"cachebench: unexpected JSON delimiter\")\n\t}\n}\n","sourceCodeStart":64,"sourceCodeEnd":89,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/strictjson.go#L64-L89","documentation":"After an array's elements were consumed, the next decoder token was missing or not the ']' delimiter — the array is unterminated or malformed. Structural guard inside the strict JSON validator's array branch.","triggerScenarios":"Thrown at cacheengine/cachebench/strictjson.go:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the truncated or malformed JSON so every array is closed with ']'","Re-serialize the body from parsed data instead of hand-editing the raw bytes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}