{"record":{"id":"dac30aa1947598a3","repo":"grpc-ecosystem/grpc-gateway","slug":"malformed-security-requirement-spec-for-key-q-va","errorCode":null,"errorMessage":"malformed security requirement spec for key %q; value is required","messagePattern":"malformed security requirement spec for key %q; value is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"protoc-gen-openapiv2/internal/genopenapi/template.go","lineNumber":2533,"sourceCode":"\t\t\t\t\texts, err := processExtensions(secDefValue.Extensions)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tnewSecDefValue.extensions = exts\n\t\t\t\t}\n\t\t\t\ts.SecurityDefinitions[secDefKey] = newSecDefValue\n\t\t\t}\n\t\t}\n\t\tif spb.Security != nil {\n\t\t\tvar newSecurity []openapiSecurityRequirementObject\n\t\t\tif s.Security != nil {\n\t\t\t\tnewSecurity = s.Security\n\t\t\t}\n\t\t\tfor _, secReq := range spb.Security {\n\t\t\t\tnewSecReq := openapiSecurityRequirementObject{}\n\t\t\t\tfor secReqKey, secReqValue := range secReq.SecurityRequirement {\n\t\t\t\t\tif secReqValue == nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"malformed security requirement spec for key %q; value is required\", secReqKey)\n\t\t\t\t\t}\n\t\t\t\t\tnewSecReqValue := make([]string, len(secReqValue.Scope))\n\t\t\t\t\tcopy(newSecReqValue, secReqValue.Scope)\n\t\t\t\t\tnewSecReq[secReqKey] = newSecReqValue\n\t\t\t\t}\n\t\t\t\tnewSecurity = append(newSecurity, newSecReq)\n\t\t\t}\n\t\t\ts.Security = newSecurity\n\t\t}\n\t\ts.ExternalDocs = protoExternalDocumentationToOpenAPIExternalDocumentation(spb.ExternalDocs, p.reg, spb)\n\t\t// Populate all Paths with Responses set at top level,\n\t\t// preferring Responses already set over those at the top level.\n\t\tif spb.Responses != nil {\n\t\t\tfor _, verbs := range s.Paths {\n\t\t\t\tvar maps []openapiResponsesObject\n\t\t\t\tif verbs.PathItemObject.Delete != nil {\n\t\t\t\t\tmaps = append(maps, verbs.PathItemObject.Delete.Responses)\n\t\t\t\t}","sourceCodeStart":2515,"sourceCodeEnd":2551,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/protoc-gen-openapiv2/internal/genopenapi/template.go#L2515-L2551","documentation":"Spec-validation error in renderServices while converting google.api SecurityRequirement protos: a security requirement map entry has a nil value, but the OpenAPI spec requires each scheme key to map to a (possibly empty) list of scopes. The offending input is the SecurityRequirement in the openapiv2 options whose value was not set.","triggerScenarios":"Thrown at protoc-gen-openapiv2/internal/genopenapi/template.go:2533 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set an (optionally empty) scopes list for every key in the security requirement.","Remove the empty entry from the openapiv2_security options if the scheme is not needed."],"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"}