-
Notifications
You must be signed in to change notification settings - Fork 455
fix: correct validation tutorial answer snippet. Fixes #750 #751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA tutorial documentation file is updated to replace the previous GET-based endpoint example with a new POST-based example that demonstrates request body validation using Elysia's schema system. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/tutorial/getting-started/validation/index.md (1)
131-142: Use spaces instead of hard tabs in code blocks.The markdown linter flags hard tabs (MD010 violation) in the answer code snippet. Markdown convention is to use spaces for indentation.
Apply this diff to replace hard tabs with spaces:
-import { Elysia, t } from 'elysia' - -new Elysia() - .post( - '/user', - ({ body: { name } }) => `Hello ${name}!`, - { - body: t.Object({ - name: t.String() - }) - } - ) - .listen(3000) +import { Elysia, t } from 'elysia' + +new Elysia() + .post( + '/user', + ({ body: { name } }) => `Hello ${name}!`, + { + body: t.Object({ + name: t.String() + }) + } + ) + .listen(3000)Note: The main example in lines 40–51 also uses hard tabs, so you may want to address the linting issue file-wide for consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/tutorial/getting-started/validation/index.md(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/tutorial/getting-started/validation/index.md
134-134: Hard tabs
Column: 1
(MD010, no-hard-tabs)
135-135: Hard tabs
Column: 1
(MD010, no-hard-tabs)
136-136: Hard tabs
Column: 1
(MD010, no-hard-tabs)
137-137: Hard tabs
Column: 1
(MD010, no-hard-tabs)
138-138: Hard tabs
Column: 1
(MD010, no-hard-tabs)
139-139: Hard tabs
Column: 1
(MD010, no-hard-tabs)
140-140: Hard tabs
Column: 1
(MD010, no-hard-tabs)
141-141: Hard tabs
Column: 1
(MD010, no-hard-tabs)
142-142: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🔇 Additional comments (1)
docs/tutorial/getting-started/validation/index.md (1)
131-142: Answer snippet correctly demonstrates request body validation.The code changes are correct and well-suited for a tutorial answer. The simplification (removing the
agefield from the schema) appropriately reduces complexity compared to the main example while still illustrating the core concept of validating request body data.
fixes an incorrect code snippet in the Validation Tutorial documentation.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.