{"record":{"id":"29526d5fe116b4a3","repo":"grpc-ecosystem/grpc-gateway","slug":"empty-identifier","errorCode":null,"errorMessage":"empty identifier","messagePattern":"empty identifier","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httprule/parse.go","lineNumber":336,"sourceCode":"\t\tcase ':', '@':\n\t\t\t// rest of pchar\n\t\tcase '%':\n\t\t\t// pct-encoded\n\t\t\tst = pct1\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid character in path segment: %q(%U)\", r, r)\n\t\t}\n\t}\n\tif st != init {\n\t\treturn fmt.Errorf(\"invalid percent-encoding in %q\", t)\n\t}\n\treturn nil\n}\n\n// expectIdent determines if \"ident\" is a valid identifier in .proto schema ([[:alpha:]_][[:alphanum:]_]*).\nfunc 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}","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/httprule/parse.go#L318-L354","documentation":"Validation-helper error from expectIdent: the identifier token expected by the httprule parser (a proto-schema identifier [[:alpha:]_][[:alphanum:]_]*) is the empty string. It fires when accept(typeIdent) is handed an empty token, typically from a malformed path template with a missing field name (e.g. '{=v}' or a trailing '.').","triggerScenarios":"Thrown at internal/httprule/parse.go:336 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the google.api.HttpRule path template so every variable and field-path component has a non-empty, valid identifier.","Check for stray separators like '..', '=.' or an empty '{}' variable in the template."],"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"}