{"record":{"id":"0ecb5a46b16ea07b","repo":"grpc-ecosystem/grpc-gateway","slug":"cannot-use-path-parameter-in-client-streaming","errorCode":null,"errorMessage":"cannot use path parameter in client streaming","messagePattern":"cannot use path parameter in client streaming","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/descriptor/services.go","lineNumber":149,"sourceCode":"\t\t\tcustom := opts.GetCustom()\n\t\t\thttpMethod = custom.Kind\n\t\t\tpathTemplate = custom.Path\n\n\t\tdefault:\n\t\t\tif grpclog.V(1) {\n\t\t\t\tgrpclog.Infof(\"No pattern specified in google.api.HttpRule: %s\", md.GetName())\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t}\n\n\t\tparsed, err := httprule.Parse(pathTemplate)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttmpl := parsed.Compile()\n\n\t\tif md.GetClientStreaming() && len(tmpl.Fields) > 0 {\n\t\t\treturn nil, errors.New(\"cannot use path parameter in client streaming\")\n\t\t}\n\n\t\tb := &Binding{\n\t\t\tMethod:     meth,\n\t\t\tIndex:      idx,\n\t\t\tPathTmpl:   tmpl,\n\t\t\tHTTPMethod: httpMethod,\n\t\t}\n\n\t\tfor _, f := range tmpl.Fields {\n\t\t\tparam, err := r.newParam(meth, f)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tb.PathParams = append(b.PathParams, param)\n\t\t}\n\n\t\t// TODO(yugui) Handle query params","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/descriptor/services.go#L131-L167","documentation":"Sentinel-style validation error raised by loadServices when building bindings: an HttpRule path template for a method whose client_streaming flag is true compiled to a template containing path parameters (tmpl.Fields non-empty). gRPC-gateway cannot fill path variables from a request body that the client streams, so the file cannot be bound and code generation aborts.","triggerScenarios":"Thrown at internal/descriptor/services.go:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove path parameters (e.g. {id}) from the HttpRule path template for the client-streaming method, using a static path or wildcard-free template.","Switch the method to server-streaming or unary if path parameters are required.","Move the identifying data into the streamed request message fields instead of the URL path."],"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"}