{"record":{"id":"ccea23001488660d","repo":"microsoft/semantic-kernel","slug":"parameter-style-of-parameter-name-parameter-of","errorCode":null,"errorMessage":"Parameter style of {parameter.Name} parameter of {operationId} operation is undefined.","messagePattern":"Parameter style of (.+?) parameter of (.+?) operation is undefined\\.","errorType":"exception","errorClass":"KernelException","httpStatus":null,"severity":"error","filePath":"dotnet/src/Functions/Functions.OpenApi/OpenApi/OpenApiDocumentParser.cs","lineNumber":437,"sourceCode":"    /// Creates REST API parameters.\n    /// </summary>\n    /// <param name=\"operationId\">The operation id.</param>\n    /// <param name=\"parameters\">The OpenAPI parameters.</param>\n    /// <returns>The parameters.</returns>\n    private static List<RestApiParameter> CreateRestApiOperationParameters(string operationId, IEnumerable<OpenApiParameter> parameters)\n    {\n        var result = new List<RestApiParameter>();\n\n        foreach (var parameter in parameters)\n        {\n            if (parameter.In is null)\n            {\n                throw new KernelException($\"Parameter location of {parameter.Name} parameter of {operationId} operation is undefined.\");\n            }\n\n            if (parameter.Style is null)\n            {\n                throw new KernelException($\"Parameter style of {parameter.Name} parameter of {operationId} operation is undefined.\");\n            }\n\n            var restParameter = new RestApiParameter(\n                parameter.Name,\n                parameter.Schema.Type,\n                parameter.Required,\n                parameter.Explode,\n                (RestApiParameterLocation)Enum.Parse(typeof(RestApiParameterLocation), parameter.In.ToString()!),\n                (RestApiParameterStyle)Enum.Parse(typeof(RestApiParameterStyle), parameter.Style.ToString()!),\n                parameter.Schema.Items?.Type,\n                GetParameterValue(parameter.Schema.Default, \"parameter\", parameter.Name),\n                parameter.Description,\n                parameter.Schema.Format,\n                parameter.Schema.ToJsonSchema()\n            );\n\n            result.Add(restParameter);\n        }","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/dotnet/src/Functions/Functions.OpenApi/OpenApi/OpenApiDocumentParser.cs#L419-L455","documentation":"Thrown by CreateRestApiOperationParameters when an OpenAPI parameter's 'style' field is null. Although 'style' has per-location defaults in the OpenAPI spec, this parser requires it to be explicitly set (non-null) so it can Enum.Parse it into a RestApiParameterStyle; an absent style is rejected rather than defaulted.","triggerScenarios":"A parameter object in the spec that omits the 'style' property. The guard runs right after the 'in' check, so only parameters that already have a valid location reach this point. The subsequent Enum.Parse on parameter.Style would otherwise throw on null.","commonSituations":"A spec authored without explicit 'style' on its parameters (relying on OpenAPI defaults); a generated spec whose serializer omitted style when it matched the default; parameters imported from an older converter that did not emit style.","solutions":["Add an explicit 'style' to each parameter matching its default per location: 'simple' for path/header, 'form' for query/cookie, or the intended array style.","Post-process the spec to fill in defaults: path/header -> simple, query/cookie -> form.","Regenerate the spec with a tool that always emits the 'style' field.","Validate with a linter configured to flag missing style."],"exampleFix":"// before - query parameter without style\n{ \"name\": \"tags\", \"in\": \"query\", \"schema\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } } }\n\n// after - explicit form style\n{ \"name\": \"tags\", \"in\": \"query\", \"style\": \"form\", \"explode\": true, \"schema\": { \"type\": \"array\", \"items\": { \"type\": \"string\" } } }","handlingStrategy":"validation","validationCode":"foreach (var (path, item) in doc.Paths)\n    foreach (var p in item.Operations.SelectMany(kv => kv.Value.Parameters))\n        if (p.Style is null)\n            throw new InvalidDataException($\"Parameter '{p.Name}' on {path} is missing 'style'.\");","typeGuard":"static bool AllParametersHaveStyle(OpenApiDocument doc)\n    => doc.Paths.SelectMany(p => p.Value.Operations.SelectMany(o => o.Value.Parameters)).All(p => p.Style is not null);","tryCatchPattern":null,"preventionTips":["Always set an explicit 'style' on every parameter.","Defaults: simple for path/header, form for query/cookie.","Post-process generated specs to fill in missing style values."],"tags":["openapi","parsing","parameter","non-compliant-spec","style"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}