{"record":{"id":"e22245de73f50e23","repo":"grpc-ecosystem/grpc-gateway","slug":"no-value-provided","errorCode":null,"errorMessage":"no value provided","messagePattern":"no value provided","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"runtime/query.go","lineNumber":110,"sourceCode":"\n\t\t// Only singular message fields are allowed\n\t\tif fieldDesc.Message() == nil || fieldDesc.Cardinality() == protoreflect.Repeated {\n\t\t\treturn fieldPath\n\t\t}\n\n\t\t// Get the nested message\n\t\tmsgValue = msgValue.Get(fieldDesc).Message()\n\t}\n\n\treturn newFieldPath\n}\n\nfunc populateFieldValueFromPath(msgValue protoreflect.Message, fieldPath []string, values []string) error {\n\tif len(fieldPath) < 1 {\n\t\treturn errors.New(\"no field path\")\n\t}\n\tif len(values) < 1 {\n\t\treturn errors.New(\"no value provided\")\n\t}\n\n\tvar fieldDescriptor protoreflect.FieldDescriptor\n\tfor i, fieldName := range fieldPath {\n\t\tfields := msgValue.Descriptor().Fields()\n\n\t\t// Get field by name\n\t\tfieldDescriptor = fields.ByName(protoreflect.Name(fieldName))\n\t\tif fieldDescriptor == nil {\n\t\t\tfieldDescriptor = fields.ByJSONName(fieldName)\n\t\t\tif fieldDescriptor == nil {\n\t\t\t\t// We're not returning an error here because this could just be\n\t\t\t\t// an extra query parameter that isn't part of the request.\n\t\t\t\tgrpclog.Infof(\"field not found in %q: %q\", msgValue.Descriptor().FullName(), strings.Join(fieldPath, \".\"))\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/runtime/query.go#L92-L128","documentation":"Returned by populateFieldValueFromPath (via runtime.PopulateFieldFromPath / Parse) when there is a field path but no values to assign to it. Populating a field requires at least one string value extracted from the request.","triggerScenarios":"Calling runtime.PopulateFieldFromPath with a valid fieldPath but empty values slice; query parsing that yields zero values for a named parameter (e.g. a query key present with no value routed through Parse).","commonSituations":"Custom request mapping where a template variable matched nothing; passing strings.Split result that returned an empty slice; wiring a query parameter key that is never populated from the URL.","solutions":["Ensure at least one value string is passed for the field path (default it if the parameter is absent)","Check the URL/query actually contains the parameter the path refers to before calling PopulateFieldFromPath","Guard the call: skip population when len(values) == 0"],"exampleFix":"// before\nerr := populate(msgValue, []string{\"id\"}, nil)\n// after\nif len(vals) == 0 { vals = []string{defaultValue} }\nerr := populate(msgValue, []string{\"id\"}, vals)","handlingStrategy":"validation","validationCode":"if len(fieldPath) > 0 && len(values) == 0 {\n    values = []string{defaultFor(fieldPath)} // or skip population\n}","typeGuard":"func hasValues(values []string) bool {\n    return len(values) > 0\n}","tryCatchPattern":"if err := runtime.PopulateFieldFromPath(msg, urlPath, fieldPath); err != nil {\n    return fmt.Errorf(\"populate %q: %w\", fieldPath, err)\n}","preventionTips":["Apply defaults for optional query parameters before population","Check the incoming URL actually contains the parameter referenced by the field path","Skip population when a matcher extracted zero values instead of forwarding empty slices"],"tags":["go","grpc-gateway","query","missing-value"],"backgroundTag":"missing-query-value","analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}