{"record":{"id":"1857137a7b0a4c91","repo":"microsoft/semantic-kernel","slug":"the-path-parameter-parameterstyle-serializatio","errorCode":null,"errorMessage":"The path parameter '{parameterStyle}' serialization style is not supported.","messagePattern":"The path parameter '(.+?)' serialization style is not supported\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs","lineNumber":337,"sourceCode":"    /// <returns>The path.</returns>\n    private string BuildPath(string pathTemplate, IDictionary<string, object?> arguments)\n    {\n        var parameters = this.Parameters.Where(p => p.Location == RestApiParameterLocation.Path);\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 path 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 path.\n            pathTemplate = pathTemplate.Replace($\"{{{parameter.Name}}}\", HttpUtility.UrlEncode(serializer.Invoke(parameter, node)));\n        }\n\n        ValidatePathSegments(pathTemplate);\n\n        return pathTemplate;\n    }\n\n    private object? GetArgumentForParameter(IDictionary<string, object?> arguments, RestApiParameter parameter)\n    {\n        // Try to get the parameter value by the argument name.\n        if (!string.IsNullOrEmpty(parameter.ArgumentName) &&\n            arguments.TryGetValue(parameter.ArgumentName!, out object? argument) &&","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Functions/Functions.OpenApi/Model/RestApiOperation.cs#L319-L355","documentation":"Thrown by RestApiOperation.BuildPath when a path parameter's effective style (parameter.Style ?? Simple) is not in s_parameterSerializers (Simple, Form, SpaceDelimited, PipeDelimited). Path parameters default to Simple, so a missing style is fine; an explicit unsupported style (Label, Matrix, DeepObject) is rejected when the URL path is built.","triggerScenarios":"An OpenAPI path parameter declared with style label ('.value') or style matrix (';key=value'), or deepObject. These produce path encodings SK does not implement.","commonSituations":"A spec authored with label or matrix path styles (valid per OpenAPI but uncommon); a converted spec retaining exotic styles; a server API that actually expects matrix-style path segments.","solutions":["Set the path parameter style to 'simple' (or remove it so Simple is assumed).","If the server requires matrix/label encoding, pre-encode the value yourself and pass it as a simple parameter, or contribute a custom serializer.","Re-author the path so the parameter is interpolated plainly as {param} with Simple serialization."],"exampleFix":"// before - matrix path style unsupported\n{ \"name\": \"id\", \"in\": \"path\", \"style\": \"matrix\", \"schema\": { \"type\": \"string\" } }\n\n// after - simple path style (default)\n{ \"name\": \"id\", \"in\": \"path\", \"style\": \"simple\", \"schema\": { \"type\": \"string\" } }","handlingStrategy":"validation","validationCode":"var supported = new[] { \"simple\", \"form\", \"spaceDelimited\", \"pipeDelimited\" };\n// iterate path params and reject label/matrix/deepObject before importing","typeGuard":"static readonly HashSet<string> SupportedPathStyles = new() { \"simple\", \"form\", \"spaceDelimited\", \"pipeDelimited\" };\nstatic bool IsSupportedPathStyle(string? style) => style is null || SupportedPathStyles.Contains(style.ToLowerInvariant());","tryCatchPattern":"try { operation.BuildPath(operation.Path, arguments); }\ncatch (KernelException ex) when (ex.Message.Contains(\"path parameter\") && ex.Message.Contains(\"serialization style is not supported\"))\n{ logger.LogError(ex, \"Unsupported path serialization style in spec.\"); throw; }","preventionTips":["Use simple (or omit style) for path parameters.","Lint the spec for matrix/label path styles.","Re-author paths as plain {param} templates."],"tags":["openapi","rest-operation","path","serialization","parameter"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}