[PR #4851] [MERGED] chore: use zod v3 syntax #5615

Closed
opened 2026-03-13 12:29:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4851
Author: @himself65
Created: 9/23/2025
Status: Merged
Merged: 9/23/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/23/zod


📝 Commits (1)

📊 Changes

37 files changed (+714 additions, -1365 deletions)

View changed files

📝 packages/better-auth/src/api/routes/account.ts (+18 -35)
📝 packages/better-auth/src/api/routes/email-verification.ts (+4 -12)
📝 packages/better-auth/src/api/routes/reset-password.ts (+16 -26)
📝 packages/better-auth/src/api/routes/session.ts (+5 -10)
📝 packages/better-auth/src/api/routes/sign-in.ts (+23 -55)
📝 packages/better-auth/src/api/routes/update-user.ts (+14 -39)
📝 packages/better-auth/src/plugins/admin/admin.ts (+64 -123)
📝 packages/better-auth/src/plugins/api-key/routes/create-api-key.ts (+21 -38)
📝 packages/better-auth/src/plugins/api-key/routes/delete-api-key.ts (+1 -3)
📝 packages/better-auth/src/plugins/api-key/routes/get-api-key.ts (+1 -3)
📝 packages/better-auth/src/plugins/api-key/routes/update-api-key.ts (+18 -48)
📝 packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts (+2 -6)
📝 packages/better-auth/src/plugins/custom-session/index.ts (+4 -7)
📝 packages/better-auth/src/plugins/device-authorization/index.ts (+26 -48)
📝 packages/better-auth/src/plugins/email-otp/index.ts (+17 -57)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+23 -50)
📝 packages/better-auth/src/plugins/magic-link/index.ts (+17 -31)
📝 packages/better-auth/src/plugins/multi-session/index.ts (+4 -6)
📝 packages/better-auth/src/plugins/oauth-proxy/index.ts (+4 -6)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+23 -58)

...and 17 more files

📄 Description

Document: https://zod.dev/metadata?id=describe
Fixes: https://github.com/better-auth/better-auth/issues/4837


Summary by cubic

Migrated all endpoint and plugin schemas to Zod v3 syntax to standardize descriptions and improve consistency. No runtime behavior changes; API inputs and outputs remain the same.

  • Refactors

    • Replaced z.meta(...) with z.describe(...) across auth routes and plugins (sessions, sign-in, account, org, API keys, 2FA, passkey, phone, magic link, SSO/OIDC, etc.).
    • Standardized schema patterns (e.g., z.coerce for ids/booleans, defaults and optionals) while preserving existing validations and OpenAPI descriptions.
  • Migration

    • If you have custom schemas using z.meta, update them to .describe.
    • No action needed for consumers unless extending schemas; endpoint contracts are unchanged.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4851 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/23/2025 **Status:** ✅ Merged **Merged:** 9/23/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/23/zod` --- ### 📝 Commits (1) - [`24fc68c`](https://github.com/better-auth/better-auth/commit/24fc68cc06c0dd22b13f824dc10ee79b6f567e0f) chore: use zod v3 syntax ### 📊 Changes **37 files changed** (+714 additions, -1365 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/account.ts` (+18 -35) 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+4 -12) 📝 `packages/better-auth/src/api/routes/reset-password.ts` (+16 -26) 📝 `packages/better-auth/src/api/routes/session.ts` (+5 -10) 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+23 -55) 📝 `packages/better-auth/src/api/routes/update-user.ts` (+14 -39) 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+64 -123) 📝 `packages/better-auth/src/plugins/api-key/routes/create-api-key.ts` (+21 -38) 📝 `packages/better-auth/src/plugins/api-key/routes/delete-api-key.ts` (+1 -3) 📝 `packages/better-auth/src/plugins/api-key/routes/get-api-key.ts` (+1 -3) 📝 `packages/better-auth/src/plugins/api-key/routes/update-api-key.ts` (+18 -48) 📝 `packages/better-auth/src/plugins/api-key/routes/verify-api-key.ts` (+2 -6) 📝 `packages/better-auth/src/plugins/custom-session/index.ts` (+4 -7) 📝 `packages/better-auth/src/plugins/device-authorization/index.ts` (+26 -48) 📝 `packages/better-auth/src/plugins/email-otp/index.ts` (+17 -57) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+23 -50) 📝 `packages/better-auth/src/plugins/magic-link/index.ts` (+17 -31) 📝 `packages/better-auth/src/plugins/multi-session/index.ts` (+4 -6) 📝 `packages/better-auth/src/plugins/oauth-proxy/index.ts` (+4 -6) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+23 -58) _...and 17 more files_ </details> ### 📄 Description Document: https://zod.dev/metadata?id=describe Fixes: https://github.com/better-auth/better-auth/issues/4837 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Migrated all endpoint and plugin schemas to Zod v3 syntax to standardize descriptions and improve consistency. No runtime behavior changes; API inputs and outputs remain the same. - **Refactors** - Replaced z.meta(...) with z.describe(...) across auth routes and plugins (sessions, sign-in, account, org, API keys, 2FA, passkey, phone, magic link, SSO/OIDC, etc.). - Standardized schema patterns (e.g., z.coerce for ids/booleans, defaults and optionals) while preserving existing validations and OpenAPI descriptions. - **Migration** - If you have custom schemas using z.meta, update them to .describe. - No action needed for consumers unless extending schemas; endpoint contracts are unchanged. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:29:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5615