Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 4, 2025

Summary

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. This is correct because plain text bodies should be sent via the data= parameter in requests, not json=.

Root cause: In PR #521, RequestBodyPlainText was incorrectly grouped with RequestBodyJsonObject to route to request_body_json. Since plain text is a string (not a dict), this caused http_requester.py line 406 to raise ValueError("Request body json cannot be a string").

Fixes: airbytehq/oncall#10360
Related: airbytehq/airbyte#69723

Updates since last revision

  • Removed test case test_string from test_interpolated_request_json_using_request_body that was testing the old buggy behavior (PlainText → JSON)
  • Added new test case test_plain_text_body to test_interpolated_request_data_using_request_body to verify the correct behavior (PlainText → data with interpolation)

Review & Testing Checklist for Human

  • Verify semantic change is correct: Confirm that RequestBodyPlainText should indeed route to request_body_data (sent as-is) rather than request_body_json (parsed as JSON). The removed test case assumed PlainText would be JSON-parsed, which conflicts with the bug report.
  • Test in Connector Builder: Create a connector with RequestBodyPlainText (POST request with plain text body) and verify it no longer throws ValueError: Request body json cannot be a string
  • Check for regressions: Verify that RequestBodyJsonObject, RequestBodyGraphQL, and RequestBodyUrlEncodedForm still work correctly

Recommended test plan:

  1. Use the YAML manifest from the issue to test:
request_body:
  type: RequestBodyPlainText
  value: Hi
  1. Verify the request is sent with the plain text body (not as JSON)

Notes

Devin AI Fix Spike - Created as part of AI triage with confidence score 4/5 (Green)

Link to Devin run: https://app.devin.ai/sessions/fdc2aff723af4077b49e3b9e472e80f2
Requested by: unknown () via /ai-triage on airbytehq/oncall#10360

…st_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 <>
@devin-ai-integration
Copy link
Contributor Author

Original prompt from API User
Issue #10360 by @Airbyte-Support: [Builder] Plain-text Body doesnt work\n\nIssue URL: https://github.com/airbytehq/oncall/issues/10360\n\nPlease use playbook macro: !issue_triage

PLAYBOOK_md:
# `/ai-triage` Slash Command Playbook

You are AI Triage Devin, an expert at analyzing Airbyte-related issues and providing actionable insights. You are responding to a GitHub slash command request. After reading the provided context, you should post a comment to confirm you understand the request and stating what your next steps will be, along with a link to your session. Once your triage and analysis is complete, update your comment with the full results of your triage. Collapse all of your comments under expandable sections.

IMPORTANT: Expect that your user has no access to the session and cannot talk with you directly. Do not wait for feedback or confirmation on any action.

## Context

You are analyzing the issue provided to you above. You will need to pull comment history on this issue to ensure you have full context.

## Your Task: Static Analysis and Triage

1. **Issue Analysis and Confirmation**: Read the complete issue content including all comments for full context.
   - **Post an initial comment immediately** (within 1-2 minutes) to confirm you understand the assignment and that you are looking into it. Include your session URL.
   - If you are missing any critical information or context (e.g., workspace UUID, connector version, error logs, reproduction steps, customer environment details), include in your initial comment a request for additional context. (Do not block waiting for an answer, but instead continue as if you will not get any more information in your current session.)

2. **Research**: Check the internet for similar errors, symptoms, or issues reported by the community. Look for:
   - Similar error messages or stack traces in Airbyte documentation.
   - Known issues in Airbyte GitHub repositories.
   - Community discussions about related problems.
   ... (8689 chars truncated...)

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1764867469-fix-plain-text-body#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1764867469-fix-plain-text-body

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment

📝 Edit this welcome message.

@github-actions github-actions bot added bug Something isn't working security labels Dec 4, 2025
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

PyTest Results (Fast)

3 818 tests  ±0   3 806 ✅ ±0   6m 19s ⏱️ +4s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit acd573a. ± Comparison against base commit daf7d48.

This pull request removes 4 and adds 4 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_graphql_query-input_request_json13-expected_request_json13]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects-input_request_json11-expected_request_json11]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects_interpolated keys-input_request_json12-expected_request_json12]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_string-input_request_json10-expected_request_json10]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_data_using_request_body[test_plain_text_body-input_request_data5-plain text body with OPTION]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_graphql_query-input_request_json12-expected_request_json12]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects-input_request_json10-expected_request_json10]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects_interpolated keys-input_request_json11-expected_request_json11]

♻️ This comment has been updated with latest results.

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 <>
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

PyTest Results (Full)

3 821 tests  ±0   3 809 ✅ ±0   10m 54s ⏱️ -1s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit acd573a. ± Comparison against base commit daf7d48.

This pull request removes 4 and adds 4 tests. Note that renamed tests count towards both.
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_graphql_query-input_request_json13-expected_request_json13]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects-input_request_json11-expected_request_json11]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects_interpolated keys-input_request_json12-expected_request_json12]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_string-input_request_json10-expected_request_json10]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_data_using_request_body[test_plain_text_body-input_request_data5-plain text body with OPTION]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_graphql_query-input_request_json12-expected_request_json12]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects-input_request_json10-expected_request_json10]
unit_tests.sources.declarative.requesters.request_options.test_interpolated_request_options_provider ‑ test_interpolated_request_json_using_request_body[test_nested_objects_interpolated keys-input_request_json11-expected_request_json11]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant