From e0a2fdb089aa8f2d4da229f65d48ff5d05e7ca75 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 16:58:23 +0000 Subject: [PATCH 1/2] fix: route RequestBodyPlainText to request_body_data instead of request_body_json This fixes a bug where RequestBodyPlainText was incorrectly routed to request_body_json, causing ValueError: 'Request body json cannot be a string' when using Plain Text body in the Connector Builder. The fix routes RequestBodyPlainText to request_body_data (like RequestBodyUrlEncodedForm) instead of request_body_json. Fixes: airbytehq/oncall#10360 Related: airbytehq/airbyte#69723 Co-Authored-By: unknown <> --- .../request_options/interpolated_request_options_provider.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py b/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py index cc961fae7..26f796f36 100644 --- a/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py +++ b/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py @@ -99,9 +99,11 @@ def _resolve_request_body(self) -> None: if self.request_body is not None and self.request_body.type is not None: if self.request_body.type == "RequestBodyUrlEncodedForm": self.request_body_data = self.request_body.value + elif self.request_body.type == "RequestBodyPlainText": + self.request_body_data = self.request_body.value elif self.request_body.type == "RequestBodyGraphQL": self.request_body_json = self.request_body.value.dict(exclude_none=True) - elif self.request_body.type in ("RequestBodyJsonObject", "RequestBodyPlainText"): + elif self.request_body.type == "RequestBodyJsonObject": self.request_body_json = self.request_body.value else: raise ValueError(f"Unsupported request body type: {self.request_body.type}") From acd573addcb4191bd7182ae3982a1aacf50447dc Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 17:07:59 +0000 Subject: [PATCH 2/2] test: update tests to reflect correct RequestBodyPlainText routing The test case 'test_string' was testing the old buggy behavior where RequestBodyPlainText was routed to request_body_json. This test has been removed and replaced with a new test case 'test_plain_text_body' in the request_body_data test function to verify the correct behavior. RequestBodyPlainText should route to request_body_data (like RequestBodyUrlEncodedForm) so that plain text is sent as-is without JSON parsing. Co-Authored-By: unknown <> --- ...test_interpolated_request_options_provider.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py b/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py index 786807aa6..2a756adff 100644 --- a/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py +++ b/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py @@ -211,14 +211,6 @@ def test_interpolated_request_json(test_name, input_request_json, expected_reque RequestBodyJsonObject(type="RequestBodyJsonObject", value={"none_value": "{{ None }}"}), {}, ), - ( - "test_string", - RequestBodyPlainText( - type="RequestBodyPlainText", - value="""{"nested": { "key": "{{ config['option'] }}" }}""", - ), - {"nested": {"key": "OPTION"}}, - ), ( "test_nested_objects", RequestBodyJsonObject( @@ -345,6 +337,14 @@ def test_interpolated_request_data(test_name, input_request_data, expected_reque ), {"2020-01-01 - 12345": "ABC"}, ), + ( + "test_plain_text_body", + RequestBodyPlainText( + type="RequestBodyPlainText", + value="plain text body with {{ config['option'] }}", + ), + "plain text body with OPTION", + ), ], ) def test_interpolated_request_data_using_request_body(