[PR #6705] [MERGED] fix: compatible with openapi 3.1 #6839

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6705
Author: @himself65
Created: 12/12/2025
Status: Merged
Merged: 12/15/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/12/12/fix


📝 Commits (3)

  • 71590c4 fix: compatible with openapi 3.1
  • 93874e4 Update packages/better-auth/src/plugins/open-api/generator.ts
  • 4da13f9 fix: test

📊 Changes

3 files changed (+4799 additions, -9 deletions)

View changed files

packages/better-auth/src/plugins/open-api/__snapshots__/open-api.test.ts.snap (+4685 -0)
📝 packages/better-auth/src/plugins/open-api/generator.ts (+10 -2)
📝 packages/better-auth/src/plugins/open-api/open-api.test.ts (+104 -7)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/6691


Summary by cubic

Updated the OpenAPI schema generator to produce 3.1-compliant nullability for optional Zod types. This removes nullable and uses union with "null" to prevent schema validation errors in 3.1 tools.

  • Bug Fixes
    • For optional types, replace nullable: true with either type: [..., "null"] when a type exists, or anyOf: [schema, { type: "null" }] as a fallback.

Written for commit 4da13f98eb. Summary will update automatically on new commits.


🔄 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/6705 **Author:** [@himself65](https://github.com/himself65) **Created:** 12/12/2025 **Status:** ✅ Merged **Merged:** 12/15/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/12/12/fix` --- ### 📝 Commits (3) - [`71590c4`](https://github.com/better-auth/better-auth/commit/71590c447aa539b1d8c0a066460728bd58d7ccef) fix: compatible with openapi 3.1 - [`93874e4`](https://github.com/better-auth/better-auth/commit/93874e40a9688534d907b20989b67f5c31f51b05) Update packages/better-auth/src/plugins/open-api/generator.ts - [`4da13f9`](https://github.com/better-auth/better-auth/commit/4da13f98eb626e44205d56217826fd5fa27eff77) fix: test ### 📊 Changes **3 files changed** (+4799 additions, -9 deletions) <details> <summary>View changed files</summary> ➕ `packages/better-auth/src/plugins/open-api/__snapshots__/open-api.test.ts.snap` (+4685 -0) 📝 `packages/better-auth/src/plugins/open-api/generator.ts` (+10 -2) 📝 `packages/better-auth/src/plugins/open-api/open-api.test.ts` (+104 -7) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/6691 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Updated the OpenAPI schema generator to produce 3.1-compliant nullability for optional Zod types. This removes nullable and uses union with "null" to prevent schema validation errors in 3.1 tools. - **Bug Fixes** - For optional types, replace nullable: true with either type: [..., "null"] when a type exists, or anyOf: [schema, { type: "null" }] as a fallback. <sup>Written for commit 4da13f98eb626e44205d56217826fd5fa27eff77. Summary will update automatically on new commits.</sup> <!-- 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 13:13:26 -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#6839