fix(declarative): route RequestBodyPlainText to request_body_data instead of request_body_json#930
Draft
Vai Ignatavicius (vai-airbyte) wants to merge 1 commit intomainfrom
Draft
Conversation
…st_body_json
RequestBodyPlainText was incorrectly grouped with RequestBodyJsonObject in
_resolve_request_body, causing plain text body values to be routed to
request_body_json. This caused a ValueError('Request body json cannot be
a string') when using RequestBodyPlainText in connector builder.
The fix routes RequestBodyPlainText to request_body_data, which correctly
handles string payloads as plain text request bodies.
Co-Authored-By: Vai Ignatavicius <vaidotas.ignatavicius@airbyte.io>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou 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/1772643208-fix-request-body-plain-text#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/1772643208-fix-request-body-plain-textPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Fast)3 870 tests +1 3 858 ✅ +1 7m 34s ⏱️ +43s Results for commit ab6a227. ± Comparison against base commit 7f41401. This pull request removes 4 and adds 5 tests. Note that renamed tests count towards both. |
PyTest Results (Full)3 873 tests 3 861 ✅ 11m 29s ⏱️ Results for commit ab6a227. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(declarative): route RequestBodyPlainText to request_body_data
Summary
RequestBodyPlainTextwas incorrectly grouped withRequestBodyJsonObjectin_resolve_request_body(), causing its string value to be routed torequest_body_json. This produced aValueError("Request body json cannot be a string")whenever a user configured a plain text request body in connector builder.The fix separates
RequestBodyPlainTextfromRequestBodyJsonObjectand routes it torequest_body_data, which correctly handles string payloads.Before (broken):
After (fixed):
Review & Testing Checklist for Human
RequestBodyPlainText→ JSON behavior. The old code routedRequestBodyPlainTextthroughrequest_body_json, which would parse JSON-like strings into dicts. If any existing connector accidentally depends on this, this fix changes their behavior. Search forRequestBodyPlainTextusage across published connector manifests.RequestBodyPlainTextvalue"\"Hi\"") and confirm the"Request body json cannot be a string"error no longer occurs.test_stringcase intest_interpolated_request_json_using_request_bodyasserted thatRequestBodyPlainTextwith a JSON string would be parsed as a JSON dict — that was validating the bug, not correct behavior.Notes