{"record":{"id":"3f5854a662aabd22","repo":"grpc-ecosystem/grpc-gateway","slug":"segment-neither-wildcards-literal-or-variable-w","errorCode":null,"errorMessage":"segment neither wildcards, literal or variable: %w","messagePattern":"segment neither wildcards, literal or variable: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httprule/parse.go","lineNumber":168,"sourceCode":"\t\t}\n\t\tsegs = append(segs, s)\n\t}\n}\n\nfunc (p *parser) segment() (segment, error) {\n\tif _, err := p.accept(\"*\"); err == nil {\n\t\treturn wildcard{}, nil\n\t}\n\tif _, err := p.accept(\"**\"); err == nil {\n\t\treturn deepWildcard{}, nil\n\t}\n\tif l, err := p.literal(); err == nil {\n\t\treturn l, nil\n\t}\n\n\tv, err := p.variable()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"segment neither wildcards, literal or variable: %w\", err)\n\t}\n\treturn v, nil\n}\n\nfunc (p *parser) literal() (segment, error) {\n\tlit, err := p.accept(typeLiteral)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn literal(lit), nil\n}\n\nfunc (p *parser) variable() (segment, error) {\n\tif _, err := p.accept(\"{\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\tpath, err := p.fieldPath()","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/httprule/parse.go#L150-L186","documentation":"Fallback error from parser.segment: a path-template segment matched none of '*', '**', literal, or variable (variable() itself failed). The wrapped error describes the underlying cause; the faulting input is the offending segment in the google.api.http path template.","triggerScenarios":"Thrown at internal/httprule/parse.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the offending segment as a literal, '*'/'**' wildcard, or '{var}' variable per http.proto syntax.","Inspect the wrapped cause (e.g. invalid identifier or missing brace) for the exact character problem."],"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"}