docs: add comprehensive response return styles reference#1357
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughAdded a new documentation page detailing Robyn's supported response return styles — plain strings, JSON, Response objects, binary data, Pydantic models, tuples, file helpers, streaming, and SSE — and wired a localized "Response Objects" link into the API Reference navigation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs_src/src/pages/documentation/en/api_reference/response-objects.mdx`:
- Around line 158-180: The CodeGroup metadata (title/tag/label) is misleading —
it says "POST /create" but the examples are for the not_found and create_user
endpoints; update the CodeGroup header to reflect the actual snippets (e.g.,
change tag/label to something like "Response examples" or "/not-found, /users"
or remove the specific POST /create label) so the CodeGroup matches the two
examples shown (functions not_found and create_user).
🪄 Autofix (Beta)
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
Run ID: 23933e7d-b771-4f69-881f-439a3d2eb485
📒 Files selected for processing (2)
docs_src/src/components/documentation/Navigation.jsxdocs_src/src/pages/documentation/en/api_reference/response-objects.mdx
| <CodeGroup title="Response" tag="POST" label="/create"> | ||
|
|
||
| ```python {{ title: 'Error response' }} | ||
| from robyn import Headers | ||
|
|
||
| @app.get("/not-found") | ||
| def not_found(): | ||
| return ( | ||
| {"error": "Resource not found"}, | ||
| Headers({"X-Error": "true"}), | ||
| 404, | ||
| ) | ||
| ``` | ||
|
|
||
| ```python {{ title: 'Created response' }} | ||
| @app.post("/users") | ||
| def create_user(): | ||
| return ( | ||
| {"id": 1, "name": "Alice"}, | ||
| Headers({}), | ||
| 201, | ||
| ) | ||
| ``` |
There was a problem hiding this comment.
Align tuple example CodeGroup metadata with the actual examples.
The CodeGroup header currently says POST /create, but the snippets demonstrate GET /not-found and POST /users. This is slightly misleading in rendered docs.
🛠️ Suggested doc fix
-<CodeGroup title="Response" tag="POST" label="/create">
+<CodeGroup title="Response" tag="EXAMPLES" label="Tuple responses">🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs_src/src/pages/documentation/en/api_reference/response-objects.mdx`
around lines 158 - 180, The CodeGroup metadata (title/tag/label) is misleading —
it says "POST /create" but the examples are for the not_found and create_user
endpoints; update the CodeGroup header to reflect the actual snippets (e.g.,
change tag/label to something like "Response examples" or "/not-found, /users"
or remove the specific POST /create label) so the CodeGroup matches the two
examples shown (functions not_found and create_user).
69c61a4 to
0106bec
Compare
Summary
Closes #769
Test plan
/documentation/en/api_reference/response-objectsMade with Cursor
Summary by CodeRabbit