Repository navigation
openapi: encode non-JSON request bodies correctly - #352
Merged
Merged
Conversation
The invoke path previously had only two branches for request bodies — JSON, or `String(bodyValue)` with whatever content-type the spec declared. For an object body that meant shipping the literal string `[object Object]` on the wire with a content-type like `application/x-www-form-urlencoded`, which servers reject or hang on waiting for valid framing. Dispatch on the declared content-type instead: form-urlencoded uses `bodyUrlParams`, multipart uses `bodyFormDataRecord` (Effect picks the boundary), pre-serialized strings pass through, and anything unknown falls back to `JSON.stringify` rather than `[object Object]`.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | ec2ebb0 | Apr 20 2026, 09:33 PM |
@executor/sdk
@executor/plugin-file-secrets
@executor/plugin-google-discovery
@executor/plugin-graphql
@executor/plugin-keychain
@executor/plugin-mcp
@executor/plugin-oauth2
@executor/plugin-onepassword
@executor/plugin-openapi
@executor/plugin-workos-vault
executor
commit: |
Collaborator
Author
5 tasks done
RhysSullivan
added a commit
that referenced
this pull request
May 31, 2026
…bodies openapi: encode non-JSON request bodies correctly
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.

Summary
String(bodyValue)with the spec's content-type. For an object body + a non-JSON content-type we shipped the literal string[object Object]on the wire, which servers reject or hold open waiting for valid framing (the "hung request" reports from Affinity).application/x-www-form-urlencoded→bodyUrlParams,multipart/form-data→bodyFormDataRecord(Effect picks the boundary), pre-serialized strings pass through unchanged, unknown non-JSON content-types fall back toJSON.stringifyinstead of[object Object].form-urlencoded-body.test.tsstands up a raw node http echo server, registers a hand-authored spec with a form-urlencoded POST, invokes it with an object body, and asserts the bytes on the wire are properly URL-encoded.Test plan
bunx vitest run src/sdk/form-urlencoded-body.test.ts— passes