{"record":{"id":"2288043f23d02190","repo":"microsoft/semantic-kernel","slug":"the-headers-parameter-parameterstyle-serializa","errorCode":null,"errorMessage":"The headers parameter '{parameterStyle}' serialization style is not supported.","messagePattern":"The headers parameter '(.+?)' serialization style is not supported\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs","lineNumber":233,"sourceCode":"    {\n        var headers = new Dictionary<string, string>();\n\n        var parameters = this.Parameters.Where(p => p.Location == RestApiParameterLocation.Header);\n\n        foreach (var parameter in parameters)\n        {\n            var argument = this.GetArgumentForParameter(arguments, parameter);\n            if (argument == null)\n            {\n                // Skipping not required parameter if no argument provided for it.    \n                continue;\n            }\n\n            var parameterStyle = parameter.Style ?? RestApiParameterStyle.Simple;\n\n            if (!s_parameterSerializers.TryGetValue(parameterStyle, out var serializer))\n            {\n                throw new KernelException($\"The headers parameter '{parameterStyle}' serialization style is not supported.\");\n            }\n\n            var node = OpenApiTypeConverter.Convert(parameter.Name, parameter.Type, argument, parameter.Schema);\n\n            //Serializing the parameter and adding it to the headers.\n            headers.Add(parameter.Name, serializer.Invoke(parameter, node));\n        }\n\n        return headers;\n    }\n\n    /// <summary>\n    /// Builds the operation query string.\n    /// </summary>\n    /// <param name=\"arguments\">The operation arguments.</param>\n    /// <returns>The query string.</returns>\n    internal string BuildQueryString(IDictionary<string, object?> arguments)\n    {","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs#L215-L251","documentation":"Thrown by RestApiOperation.BuildHeaders when a header parameter's effective style (parameter.Style ?? Simple) is not present in the s_parameterSerializers dictionary. The supported styles are Simple, Form, SpaceDelimited, and PipeDelimited. Any other style (Label, Matrix, DeepObject) for a header parameter is unsupported and rejected at request-build time.","triggerScenarios":"An OpenAPI header parameter declared with style label or style matrix (or deepObject), none of which SK has a serializer for. The default for headers is Simple, so a missing style is fine; only an explicit unsupported style triggers this.","commonSituations":"A spec authored with an unusual header serialization style; a tool that emits label/matrix styles by default for header params; copying a spec that targets a different client library with broader style support.","solutions":["Edit the spec: change the offending header parameter's style to 'simple' (or remove the style field so Simple is used).","If the style is genuinely required by the server, contribute a serializer or preprocess the document to remap the style.","Filter the parameter out via OpenApiFunctionExecutionParameters.ParameterFilter if it is not needed for your calls."],"exampleFix":"// before - unsupported header style\n{ \"name\": \"X-Tag\", \"in\": \"header\", \"style\": \"label\", \"schema\": { } }\n\n// after - supported (default) style\n{ \"name\": \"X-Tag\", \"in\": \"header\", \"style\": \"simple\", \"schema\": { } }","handlingStrategy":"validation","validationCode":"var supported = new[] { \"simple\", \"form\", \"spaceDelimited\", \"pipeDelimited\" };\n// iterate header params and flag label/matrix/deepObject before importing","typeGuard":"static readonly HashSet<string> SupportedHeaderStyles = new() { \"simple\", \"form\", \"spaceDelimited\", \"pipeDelimited\" };\nstatic bool IsSupportedHeaderStyle(string? style) => style is null || SupportedHeaderStyles.Contains(style.ToLowerInvariant());","tryCatchPattern":"try { operation.BuildHeaders(arguments); }\ncatch (KernelException ex) when (ex.Message.Contains(\"headers parameter\") && ex.Message.Contains(\"serialization style is not supported\"))\n{ logger.LogError(ex, \"Unsupported header serialization style in spec.\"); throw; }","preventionTips":["Use simple (or omit style) for header parameters.","Lint the spec for label/matrix/deepObject styles on headers.","Drop unused header parameters via ParameterFilter."],"tags":["openapi","rest-operation","header","serialization","parameter"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}