Skip to content

Conversation

kkane
Copy link
Contributor

@kkane kkane commented Sep 27, 2025

fix zod validation documentation: https://tanstack.com/start/latest/docs/framework/react/server-functions#validation-with-zod

Summary by CodeRabbit

  • Documentation
    • Updated server functions guide to show passing a Zod schema directly to inputValidator (e.g., UserSchema) instead of calling parse explicitly.
    • Clarifies validation usage and reduces boilerplate in examples while preserving existing behavior.

Copy link
Contributor

coderabbitai bot commented Sep 27, 2025

Walkthrough

Updated a documentation example to pass a Zod schema directly to inputValidator instead of a validator function invoking UserSchema.parse(data). No control-flow or API changes; only the example usage text was modified.

Changes

Cohort / File(s) Summary
Docs example update
docs/start/framework/react/server-functions.md
Revised example to provide UserSchema directly to inputValidator instead of a wrapper function calling UserSchema.parse(data). No other content or logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nibbled the docs with careful delight,
Swapped parse for a schema—clean, concise, right.
Hop, hop, the examples now neatly align,
Zod at the ready, validation just fine.
Carrots for clarity—merge time tonight! 🥕✨

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 title “fix Validation with Zod documentation” clearly and succinctly describes the primary change, which is updating the Zod validation example in the documentation, without extraneous details or vague phrasing.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07a123d and e6584ec.

📒 Files selected for processing (1)
  • docs/start/framework/react/server-functions.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

Files:

  • docs/start/framework/react/server-functions.md
docs/{router,start}/**

📄 CodeRabbit inference engine (AGENTS.md)

Place router docs under docs/router/ and start framework docs under docs/start/

Files:

  • docs/start/framework/react/server-functions.md
🔇 Additional comments (1)
docs/start/framework/react/server-functions.md (1)

101-105: Doc example now aligns with schema-aware validators

Passing UserSchema directly into .inputValidator() matches the current Start API and keeps the sample consistent with the other schema-based snippets in this guide. Nice cleanup.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@github-actions github-actions bot added the documentation Everything documentation related label Sep 27, 2025
@schiller-manuel schiller-manuel merged commit 985f8c6 into TanStack:main Sep 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Everything documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants