{"record":{"id":"7b639803983c68db","repo":"tomnomnom/gron","slug":"invalid-quoted-key-s","errorCode":null,"errorMessage":"invalid quoted key `%s`","messagePattern":"invalid quoted key `(.+?)`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ungron.go","lineNumber":414,"sourceCode":"\n\tcase t.typ == typBare:\n\t\tval, err := ungronTokens(ts[1:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tout := make(map[string]interface{})\n\t\tout[t.text] = val\n\t\treturn out, nil\n\n\tcase t.typ == typQuotedKey:\n\t\tval, err := ungronTokens(ts[1:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkey := \"\"\n\t\terr = json.Unmarshal([]byte(t.text), &key)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid quoted key `%s`\", t.text)\n\t\t}\n\n\t\tout := make(map[string]interface{})\n\t\tout[key] = val\n\t\treturn out, nil\n\n\tcase t.typ == typNumericKey:\n\t\tkey, err := strconv.Atoi(t.text)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid integer key `%s`\", t.text)\n\t\t}\n\n\t\tval, err := ungronTokens(ts[1:])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// There needs to be at least key + 1 space in the array","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/tomnomnom/gron/blob/88a6234ea2d0c487090988182ad9a7cdf6def924/ungron.go#L396-L432","documentation":"During statement un-groning, a token classified as a quoted key (typQuotedKey) fails json.Unmarshal into a string, meaning the token's text is not a valid JSON quoted string. This fires on malformed input like unterminated or badly escaped quotes.","triggerScenarios":"Thrown at ungron.go:414 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the quoted key in the input so it is a valid JSON string (matching quotes, proper escaping)","Check the input statement around the reported token for stray or missing quote characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88a6234ea2d0c487090988182ad9a7cdf6def924","analyzedAt":"2026-09-06T11:35:31.658Z","contentChangedAt":"2026-09-06T11:35:31.658Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}