docs: fix ASR content-type warning + document WS HTTP/1.1 handshake - #115
docs: fix ASR content-type warning + document WS HTTP/1.1 handshake#115M2Night wants to merge 1 commit into
Conversation
Found while helping Vercel build a Fish Audio provider for the AI SDK. - Speech to Text warning: the endpoint accepts multipart/form-data (not the non-existent "application/form-data") and application/msgpack; note that application/json is not usable (audio cannot be carried as JSON/base64). - WebSocket TTS (asyncapi): document that the handshake must use HTTP/1.1 — HTTP/2 upgrade requests are rejected with 400 "invalid protocol". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
📝 WalkthroughWalkthroughThe API documentation now defines the HTTP/1.1 requirement for ChangesAPI documentation updates
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api-reference/endpoint/openapi-v1/speech-to-text.mdx`:
- Line 10: Update the endpoint description to explicitly state that it rejects
JSON request bodies containing base64-encoded audio, while preserving the listed
accepted content types and avoiding the ambiguous “JSON/base64” phrasing.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 133e26a3-9998-4324-9f24-e2f8a865d17a
📒 Files selected for processing (2)
api-reference/asyncapi.ymlapi-reference/endpoint/openapi-v1/speech-to-text.mdx
|
|
||
| <Warning> | ||
| This BETA endpoint only accepts `application/form-data` and `application/msgpack`. | ||
| This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` (the audio field cannot be carried as JSON/base64). |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Clarify the JSON restriction.
JSON/base64 combines a media type and an encoding. State that the endpoint rejects JSON bodies with base64-encoded audio.
Proposed wording
-This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` (the audio field cannot be carried as JSON/base64).
+This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` with base64-encoded audio.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` (the audio field cannot be carried as JSON/base64). | |
| This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` with base64-encoded audio. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@api-reference/endpoint/openapi-v1/speech-to-text.mdx` at line 10, Update the
endpoint description to explicitly state that it rejects JSON request bodies
containing base64-encoded audio, while preserving the listed accepted content
types and avoiding the ambiguous “JSON/base64” phrasing.
Source: Coding guidelines
What
Two documentation fixes found while helping Vercel build a Fish Audio provider for the AI SDK.
Changes
speech-to-text.mdx):application/form-datais not a real MIME type →multipart/form-data; also noteapplication/jsonis not usable (the audio field cannot be carried as JSON/base64). Verified: JSON+base64 →HTTP 400;multipart/form-data→ 200.asyncapi.yml): document that the handshake must use HTTP/1.1 — HTTP/2 upgrade requests are rejected with400 "invalid protocol". Verified live (curl--http1.1→101; default HTTP/2 →400 invalid protocol).Note
The
/v1/asrOpenAPI content-type list itself is corrected in the companion platform-api PR (that repo generatesopenapi.json, synced here viascripts/update-openapi.mjs).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
multipart/form-datawith clarification thatapplication/jsonis not accepted for audio data submission.