{"record":{"id":"c0ecbffb676be804","repo":"grpc-ecosystem/grpc-gateway","slug":"invalid-character-q-u-in-identifier-s","errorCode":null,"errorMessage":"invalid character %q(%U) in identifier: %s","messagePattern":"invalid character %q\\(%U\\) in identifier: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httprule/parse.go","lineNumber":352,"sourceCode":"func expectIdent(ident string) error {\n\tif ident == \"\" {\n\t\treturn errors.New(\"empty identifier\")\n\t}\n\tfor pos, r := range ident {\n\t\tswitch {\n\t\tcase '0' <= r && r <= '9':\n\t\t\tif pos == 0 {\n\t\t\t\treturn fmt.Errorf(\"identifier starting with digit: %s\", ident)\n\t\t\t}\n\t\t\tcontinue\n\t\tcase 'A' <= r && r <= 'Z':\n\t\t\tcontinue\n\t\tcase 'a' <= r && r <= 'z':\n\t\t\tcontinue\n\t\tcase r == '_':\n\t\t\tcontinue\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid character %q(%U) in identifier: %s\", r, r, ident)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc isHexDigit(r rune) bool {\n\tswitch {\n\tcase '0' <= r && r <= '9':\n\t\treturn true\n\tcase 'A' <= r && r <= 'F':\n\t\treturn true\n\tcase 'a' <= r && r <= 'f':\n\t\treturn true\n\t}\n\treturn false\n}\n","sourceCodeStart":334,"sourceCodeEnd":369,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/httprule/parse.go#L334-L369","documentation":"Identifier-validation error from expectIdent: the token contains a character outside [A-Za-z0-9_] (and does not merely start with a digit). accept(typeIdent) rejects it, so the faulting input is a malformed identifier — e.g. containing '-', '.', or spaces — in the HttpRule path template.","triggerScenarios":"Thrown at internal/httprule/parse.go:352 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace invalid characters with letters, digits or underscores in the identifier.","Ensure field-path components use the actual proto field names without decoration."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}