{"record":{"id":"79f79743c044f0e9","repo":"grpc-ecosystem/grpc-gateway","slug":"unknown-message-type-s","errorCode":null,"errorMessage":"unknown message type %s","messagePattern":"unknown message type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"protoc-gen-openapiv2/internal/genopenapi/template.go","lineNumber":449,"sourceCode":"\t\t\t\tparam.Default = getEnumDefault(reg, enum)\n\t\t\t\tif reg.GetEnumsAsInts() {\n\t\t\t\t\tparam.Type = \"integer\"\n\t\t\t\t\tparam.Enum = listEnumNumbers(reg, enum)\n\t\t\t\t\tparam.Default = getEnumDefaultNumber(reg, enum)\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalueComments := enumValueProtoComments(reg, enum)\n\t\t\tif valueComments != \"\" {\n\t\t\t\tparam.Description = strings.TrimLeft(param.Description+\"\\n\\n \"+valueComments, \"\\n\")\n\t\t\t}\n\t\t}\n\t\treturn []openapiParameterObject{param}, nil\n\t}\n\n\t// nested type, recurse\n\tmsg, err := reg.LookupMsg(\"\", fieldType)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unknown message type %s\", fieldType)\n\t}\n\n\t// Check for cyclical message reference:\n\tif ok := cycle.Check(*msg.Name); !ok {\n\t\treturn nil, fmt.Errorf(\"exceeded recursive count (%d) for query parameter %q\", cycle.count, fieldType)\n\t}\n\n\t// Construct a new map with the message name so a cycle further down the recursive path can be detected.\n\t// Do not keep anything in the original touched reference and do not pass that reference along.  This will\n\t// prevent clobbering adjacent records while recursing.\n\ttouchedOut := cycle.Branch()\n\n\tfor _, nestedField := range msg.Fields {\n\t\tif !isVisible(getFieldVisibilityOption(nestedField), reg) {\n\t\t\tcontinue\n\t\t}\n\n\t\tfieldName := reg.FieldName(field)","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/protoc-gen-openapiv2/internal/genopenapi/template.go#L431-L467","documentation":"In genopenapi's nestedQueryParams, a nested (message-typed) query parameter is resolved via reg.LookupMsg; failure yields 'unknown message type %s'. The generator recursed into a query-path field that is a message, but that message isn't registered — usually because its defining file wasn't loaded during generation.","triggerScenarios":"queryParams/nestedQueryParams recursion on a nested message field where reg.LookupMsg(\"\", fieldType) fails — message defined in a dependency proto not passed to protoc, or the type name is stale/renamed.","commonSituations":"GET endpoints with deeply nested request messages whose sub-messages come from included packages not provided to protoc; generating docs for only part of the API surface; recent proto renames not fully regenerated.","solutions":["Pass all dependent proto files (where the nested message is defined) to the protoc invocation.","Confirm the field's type name resolves in your proto tree (no renames/typos).","Regenerate descriptors for the whole package set at once.","If the message intentionally can't be exposed, flatten the query parameter structure in the request proto."],"exampleFix":"// before\nprotoc --openapiv2_out=. api.proto  # nested request type lives in common.proto\n\n// after\nprotoc -I . --openapiv2_out=. api.proto common.proto","handlingStrategy":"validation","validationCode":"// Verify nested message types resolve before generating docs:\nfor _, t := range nestedQueryTypeNames {\n    if _, err := reg.LookupMsg(\"\", t); err != nil {\n        return fmt.Errorf(\"nested message %s missing from protoc invocation\", t)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bundle all dependency protos in the same protoc command.","After renames, grep request messages for stale nested type references.","Generate OpenAPI docs from a full descriptor set, not per-file fragments."],"tags":["codegen","openapi","message-lookup","proto-registry"],"backgroundTag":"proto-type-not-found","analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}