{"record":{"id":"957ae9f3a3c6a579","repo":"microsoft/semantic-kernel","slug":"payload-parameters-cannot-be-retrieved-from-the-957ae9","errorCode":null,"errorMessage":"Payload parameters cannot be retrieved from the `{operation.id}` operation payload metadata because it is missing.","messagePattern":"Payload parameters cannot be retrieved from the `(.+?)` operation payload metadata because it is missing\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py","lineNumber":500,"sourceCode":"            else:\n                # Handle property.properties as a single instance or a list\n                if isinstance(property.properties, RestApiPayloadProperty):\n                    nested_properties = [property.properties]\n                else:\n                    nested_properties = property.properties\n\n                parameters.extend(\n                    self._get_parameters_from_payload_metadata(nested_properties, enable_namespacing, parameter_name)\n                )\n        return parameters\n\n    def get_payload_parameters(\n        self, operation: \"RestApiOperation\", use_parameters_from_metadata: bool, enable_namespacing: bool\n    ):\n        \"\"\"Get the payload parameters for the operation.\"\"\"\n        if use_parameters_from_metadata:\n            if operation.request_body is None:\n                raise Exception(\n                    f\"Payload parameters cannot be retrieved from the `{operation.id}` \"\n                    f\"operation payload metadata because it is missing.\"\n                )\n            if operation.request_body.media_type == RestApiOperation.MEDIA_TYPE_TEXT_PLAIN:\n                return [self.create_payload_artificial_parameter(operation)]\n\n            return self._get_parameters_from_payload_metadata(operation.request_body.properties, enable_namespacing)\n\n        return [\n            self.create_payload_artificial_parameter(operation),\n            self.create_content_type_artificial_parameter(),\n        ]\n\n    def get_default_response(\n        self, responses: dict[str, RestApiExpectedResponse], preferred_responses: list[str]\n    ) -> RestApiExpectedResponse | None:\n        \"\"\"Get the default response for the operation.\n","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/openapi_plugin/models/rest_api_operation.py#L482-L518","documentation":"When `get_payload_parameters` is called with `use_parameters_from_metadata=True`, it expects the operation to have a `request_body` defined (from the OpenAPI spec). If `operation.request_body` is None — meaning the spec declared no request body for this operation — this generic Exception is raised. It signals a mismatch: the caller asked for payload-parameter extraction from metadata, but there is no payload metadata to extract from.","triggerScenarios":"Calling an OpenAPI operation function with `use_parameters_from_metadata=True` (or the runner defaulting to it) for an operation that has no request body defined in the OpenAPI spec. The operation is a GET or DELETE with no body, but payload metadata extraction was requested.","commonSituations":"The OpenAPI runner is configured to extract payload parameters from metadata globally, but some operations (GET, DELETE) have no request body. A spec was modified to remove a request body but the runner configuration was not updated. Note: this raises a bare `Exception` (not FunctionExecutionException), which is a code-quality concern.","solutions":["Set `use_parameters_from_metadata=False` for operations that have no request body, so a synthetic payload parameter is used instead.","Add a request body to the operation in the OpenAPI spec if one is expected.","Filter or skip operations without request bodies when iterating with metadata-based payload extraction enabled."],"exampleFix":"// before\nrunner = OpenAPIFunctionRunner(use_parameters_from_metadata=True)\n# applied to a GET operation with no body -> raises\n// after\nrunner = OpenAPIFunctionRunner(use_parameters_from_metadata=False)\n# or only enable metadata extraction for operations that have a request body","handlingStrategy":"type-guard","validationCode":"def has_request_body(operation) -> bool:\n    return operation.request_body is not None","typeGuard":"def operation_has_payload(operation: 'RestApiOperation') -> bool:\n    \"\"\"Return True if the operation has request body metadata for payload extraction.\"\"\"\n    return operation.request_body is not None","tryCatchPattern":"try:\n    params = builder.get_payload_parameters(operation, use_parameters_from_metadata=True, enable_namespacing=True)\nexcept Exception as e:\n    if \"payload metadata\" in str(e) and \"missing\" in str(e):\n        # fall back to use_parameters_from_metadata=False for this operation\n        params = builder.get_payload_parameters(operation, use_parameters_from_metadata=False, enable_namespacing=True)","preventionTips":["Check operation.request_body is not None before calling get_payload_parameters with use_parameters_from_metadata=True.","Set use_parameters_from_metadata=False for GET/DELETE operations that have no body.","Filter operations without request bodies when iterating with metadata-based extraction."],"tags":["openapi","rest-api","payload","request-body","semantic-kernel"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}