[PR #4710] [MERGED] fix: reduce any type in generator.ts #5541

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

📋 Pull Request Information

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

Base: canaryHead: himself65/2025/09/16/type


📝 Commits (1)

  • be5d86b fix: reduce any type in generator.ts

📊 Changes

1 file changed (+22 additions, -5 deletions)

View changed files

📝 packages/better-auth/src/plugins/open-api/generator.ts (+22 -5)

📄 Description

Summary by cubic

Tightened type safety in the OpenAPI generator by replacing any with explicit schema types. No runtime changes.

  • Refactors
    • Introduced FieldSchema and OpenAPIModelSchema types.
    • Typed properties as Record<string, FieldSchema> and models as Record<string, OpenAPIModelSchema>.
    • Used FieldType and FieldAttributeConfig["defaultValue"] for accurate field defaults.
    • Removed @ts-expect-error.

🔄 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/4710 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/16/2025 **Status:** ✅ Merged **Merged:** 9/16/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/16/type` --- ### 📝 Commits (1) - [`be5d86b`](https://github.com/better-auth/better-auth/commit/be5d86bec0b33b0389dd2866ade3e7cd8b1ac112) fix: reduce any type in generator.ts ### 📊 Changes **1 file changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/open-api/generator.ts` (+22 -5) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Tightened type safety in the OpenAPI generator by replacing any with explicit schema types. No runtime changes. - **Refactors** - Introduced FieldSchema and OpenAPIModelSchema types. - Typed properties as Record<string, FieldSchema> and models as Record<string, OpenAPIModelSchema>. - Used FieldType and FieldAttributeConfig["defaultValue"] for accurate field defaults. - Removed @ts-expect-error. <!-- 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:26:34 -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#5541