{"record":{"id":"f61f5809c2462aae","repo":"grpc-ecosystem/grpc-gateway","slug":"invalid-character-in-path-segment-q-u","errorCode":null,"errorMessage":"invalid character in path segment: %q(%U)","messagePattern":"invalid character in path segment: %q\\(%U\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httprule/parse.go","lineNumber":324,"sourceCode":"\t\tcase 'A' <= r && r <= 'Z':\n\t\t\tcontinue\n\t\tcase 'a' <= r && r <= 'z':\n\t\t\tcontinue\n\t\tcase '0' <= r && r <= '9':\n\t\t\tcontinue\n\t\t}\n\t\tswitch r {\n\t\tcase '-', '.', '_', '~':\n\t\t\t// unreserved\n\t\tcase '!', '$', '&', '\\'', '(', ')', '*', '+', ',', ';', '=':\n\t\t\t// sub-delims\n\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)","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/httprule/parse.go#L306-L342","documentation":"Lexical-validation error from expectPChars: a character in the path-template literal is not an allowed RFC 3986 pchar (unreserved, sub-delims, ':', '@', or start of a percent-encoding). The literal contains a character such as space, '?' or ']' that http.proto path templates forbid; the error names the character and code point.","triggerScenarios":"Thrown at internal/httprule/parse.go:324 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or percent-encode the disallowed character in the HttpRule path template.","Use only unreserved/sub-delims characters, ':', '@', or valid %XX escapes in literals."],"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"}