Skip to content

Conversation

@ajitzero
Copy link
Contributor

@ajitzero ajitzero commented Oct 20, 2025

Corrected typos and improved clarity in the validation documentation.

Summary by CodeRabbit

  • Documentation
    • Refreshed validation getting-started tutorial with improved, practical examples
    • Corrected grammatical issues and refined prose for better clarity
    • Enhanced demonstrations of request body validation and schema patterns
    • Improved example structure to better illustrate validation best practices
    • Standardized terminology throughout validation documentation

Corrected typos and improved clarity in the validation documentation.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Walkthrough

The validation tutorial documentation was updated to showcase the newly exported t named export from the elysia module. Examples were modified to demonstrate type validation using t.Object, t.String, and t.Number. A sample route was converted from GET to POST-based validation. Grammatical corrections and stylistic improvements were applied throughout.

Changes

Cohort / File(s) Change Summary
Validation Tutorial Documentation
docs/tutorial/getting-started/validation/index.md
Updated examples to import and use the t named export alongside Elysia for type validation. Changed sample route from GET to POST with body schema validation. Applied grammatical corrections ("infers" vs "infer", "type-check" hyphenation) and improved phrasing for consistency.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny t hops in with grace,
Validation schemas find their place!
POST replaces GET's old way,
Types are checked in brighter day.
Grammar tidied, docs now shine—
Elysia's tutorial feels divine! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Fix typos and update correct answer in validation test" is partially related to the changeset. The title correctly identifies a real aspect of the changes—fixing typos and grammatical errors throughout the validation documentation. However, the title uses "validation test" when the affected file is actually docs/tutorial/getting-started/validation/index.md, which is documentation rather than a test file. More significantly, the title does not capture a major component of the changes: updating validation tutorial examples to use a newly exported t API from the elysia module, which represents a notable shift in the public API demonstration. The title focuses on the typo fixes but misses the substantial example refactoring and API updates that appear to be core objectives.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a2ab5b and 3c087d2.

📒 Files selected for processing (1)
  • docs/tutorial/getting-started/validation/index.md (2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/tutorial/getting-started/validation/index.md

133-133: Hard tabs
Column: 1

(MD010, no-hard-tabs)


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 (3)
docs/tutorial/getting-started/validation/index.md (3)

92-92: Verify grammar for type inference statement.

Line 92 uses "infer type" which appears incomplete. The phrasing should be either "infer types" (plural) or "infer the type" (with article).

Please confirm the intended phrasing:

  • "Elysia will infer types for you, so you don't have to define a separate schema in TypeScript."
  • "Elysia will infer the type for you, so you don't have to define a separate schema in TypeScript."

97-99: Grammatical and stylistic improvements are well-executed.

The changes to line 97 ("type-check the response") and line 99 ("specify which status code") improve clarity and consistency with style guidelines.


123-123: Typo fix looks good.

Line 123 correctly fixes the typo from "execrise" to "exercise".

Comment on lines +130 to +142
import { Elysia, t } from 'elysia'

new Elysia()
.get('/', ({ status, set }) => {
set.headers['x-powered-by'] = 'Elysia'

return status(418, 'Hello Elysia!')
})
.get('/docs', ({ redirect }) => redirect('https://elysiajs.com'))
.post(
'/user',
({ body: { name } }) => `Hello ${name}!`,
{
body: t.Object({
name: t.String(),
age: t.Number()
})
}
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update assignment answer with proper schema, but fix indentation.

The assignment answer has been appropriately updated to showcase the t named export with t.Object, t.String(), and t.Number() validation. However, the code block uses hard tabs instead of spaces, which violates the project's Markdown style guidelines (markdownlint MD010).

Replace hard tabs with spaces (typically 2 or 4 spaces per indentation level to match the rest of the codebase):

 ```typescript
-import { Elysia, t } from 'elysia'
+import { Elysia, t } from 'elysia'
 
 new Elysia()
-	.post(
+  .post(
-		'/user',
+    '/user',
-		({ body: { name } }) => `Hello ${name}!`,
+    ({ body: { name } }) => `Hello ${name}!`,
-		{
+    {
-			body: t.Object({
+      body: t.Object({
-				name: t.String(),
+        name: t.String(),
-				age: t.Number()
+        age: t.Number()
-			})
+      })
-		}
+    }
-	)
+  )
   .listen(3000)
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

133-133: Hard tabs
Column: 1

(MD010, no-hard-tabs)


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)

🤖 Prompt for AI Agents
In docs/tutorial/getting-started/validation/index.md around lines 130 to 142,
the example uses hard tabs for indentation which violates the Markdown style
guide; replace all hard tabs with spaces (use 2 spaces per indent to match the
repository style), re-indent the chained .post call, its route, handler, options
object and nested t.Object properties consistently with 2-space indentation, and
ensure the closing parentheses and the final .listen(3000) line align with the
adjusted indentation.

@ajitzero ajitzero closed this Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant