{"record":{"id":"47d42975b36369db","repo":"grpc-ecosystem/grpc-gateway","slug":"identifier-starting-with-digit-s","errorCode":null,"errorMessage":"identifier starting with digit: %s","messagePattern":"identifier starting with digit: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httprule/parse.go","lineNumber":342,"sourceCode":"\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}\n\treturn nil\n}\n\nfunc isHexDigit(r rune) bool {\n\tswitch {\n\tcase '0' <= r && r <= '9':","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/httprule/parse.go#L324-L360","documentation":"Identifier-validation error from expectIdent: the token that must be a proto-schema identifier begins with a digit (e.g. '1abc'). Proto identifiers must start with a letter or underscore; accept(typeIdent) rejects the token so the path template or field path cannot be parsed.","triggerScenarios":"Thrown at internal/httprule/parse.go:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the field/variable so it starts with a letter or underscore.","Quote nothing — http.proto templates have no quoting; adjust the template to reference a valid identifier."],"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"}