{"record":{"id":"207715bc5e4a8f91","repo":"grpc-ecosystem/grpc-gateway","slug":"unterminated-variable-segment-s","errorCode":null,"errorMessage":"unterminated variable segment: %s","messagePattern":"unterminated variable segment: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httprule/parse.go","lineNumber":202,"sourceCode":"\t}\n\n\tpath, err := p.fieldPath()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar segs []segment\n\tif _, err := p.accept(\"=\"); err == nil {\n\t\tsegs, err = p.segments()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid segment in variable %q: %w\", path, err)\n\t\t}\n\t} else {\n\t\tsegs = []segment{wildcard{}}\n\t}\n\n\tif _, err := p.accept(\"}\"); err != nil {\n\t\treturn nil, fmt.Errorf(\"unterminated variable segment: %s\", path)\n\t}\n\treturn variable{\n\t\tpath:     path,\n\t\tsegments: segs,\n\t}, nil\n}\n\nfunc (p *parser) fieldPath() (string, error) {\n\tc, err := p.accept(typeIdent)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcomponents := []string{c}\n\tfor {\n\t\tif _, err := p.accept(\".\"); err != nil {\n\t\t\treturn strings.Join(components, \".\"), nil\n\t\t}\n\t\tc, err := p.accept(typeIdent)","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/httprule/parse.go#L184-L220","documentation":"Parser error from parser.variable: the closing '}' of a variable segment was not found where expected, i.e. the HttpRule path template opens '{name' but never closes it. The error names the variable path so the unclosed brace can be located.","triggerScenarios":"Thrown at internal/httprule/parse.go:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the missing '}' to close the variable in the path template.","Check that wildcard patterns inside the variable did not swallow the closing brace."],"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"}