{"record":{"id":"82aee809e2066cf3","repo":"JuliusBrussee/caveman","slug":"cachebench-json-nesting-limit-exceeded","errorCode":null,"errorMessage":"cachebench: JSON nesting limit exceeded","messagePattern":"cachebench: JSON nesting limit exceeded","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/strictjson.go","lineNumber":36,"sourceCode":"\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc validUniqueJSONObject(body []byte) bool {\n\tdecoder := json.NewDecoder(bytes.NewReader(body))\n\tdecoder.UseNumber()\n\tif err := validateUniqueJSONValue(decoder, true, 0); err != nil {\n\t\treturn false\n\t}\n\t_, err := decoder.Token()\n\treturn errors.Is(err, io.EOF)\n}\n\nfunc validateUniqueJSONValue(decoder *json.Decoder, root bool, depth int) error {\n\tif depth > 512 {\n\t\treturn errors.New(\"cachebench: JSON nesting limit exceeded\")\n\t}\n\ttoken, err := decoder.Token()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdelimiter, composite := token.(json.Delim)\n\tif !composite {\n\t\tif root {\n\t\t\treturn errors.New(\"cachebench: JSON root must be object\")\n\t\t}\n\t\treturn nil\n\t}\n\tswitch delimiter {\n\tcase '{':\n\t\tseen := map[string]bool{}\n\t\tfor decoder.More() {\n\t\t\tkeyToken, err := decoder.Token()\n\t\t\tif err != nil {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/strictjson.go#L18-L54","documentation":"Error \"cachebench: JSON nesting limit exceeded\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/strictjson.go:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce JSON nesting below the limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}