[PR #8389] [MERGED] fix(open-api): correct get-session nullable schema for OAS 3.1 #24842

Closed
opened 2026-04-15 22:35:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8389
Author: @Oluwatobi-Mustapha
Created: 3/4/2026
Status: Merged
Merged: 4/9/2026
Merged by: @ping-maxwell

Base: mainHead: fix/oas-3-1-get-session-8367


📝 Commits (3)

  • 986ac95 fix(open-api): correct get-session nullable schema for OAS 3.1
  • 1bd7de3 Merge branch 'main' into fix/oas-3-1-get-session-8367
  • cd570d4 chore: changeset

📊 Changes

4 files changed (+29 additions, -6 deletions)

View changed files

.changeset/honest-regions-jam.md (+5 -0)
📝 packages/better-auth/src/api/routes/session.ts (+2 -2)
📝 packages/better-auth/src/plugins/open-api/__snapshots__/open-api.test.ts.snap (+8 -4)
📝 packages/better-auth/src/plugins/open-api/open-api.test.ts (+14 -0)

📄 Description

Fixes #8367

Updates /get-session 200 response schema to OAS 3.1 null union (type: ["object", "null"]) and removes deprecated nullable usage for that endpoint.

Adds a regression test and updates the OpenAPI snapshot.


Summary by cubic

Fixes POST /get-session 200 response schema for OpenAPI 3.1 by replacing deprecated nullable with a union type. Ensures clients and tooling correctly handle null responses per Linear #8367.

  • Bug Fixes
    • Use type ["object", "null"] instead of nullable: true for the 200 schema.
    • Add changeset for better-auth patch release.
    • Add a test asserting the union type and absence of nullable on /get-session, and update the OpenAPI snapshot.

Written for commit cd570d4336. Summary will update 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/8389 **Author:** [@Oluwatobi-Mustapha](https://github.com/Oluwatobi-Mustapha) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 4/9/2026 **Merged by:** [@ping-maxwell](https://github.com/ping-maxwell) **Base:** `main` ← **Head:** `fix/oas-3-1-get-session-8367` --- ### 📝 Commits (3) - [`986ac95`](https://github.com/better-auth/better-auth/commit/986ac95ab0885cd92cdff50d2069830a02bb6e6e) fix(open-api): correct get-session nullable schema for OAS 3.1 - [`1bd7de3`](https://github.com/better-auth/better-auth/commit/1bd7de388a3d1b231e854a5bd867c5f0b7c37c6a) Merge branch 'main' into fix/oas-3-1-get-session-8367 - [`cd570d4`](https://github.com/better-auth/better-auth/commit/cd570d433695988d5ad9f6fad19a575e6274c339) chore: changeset ### 📊 Changes **4 files changed** (+29 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/honest-regions-jam.md` (+5 -0) 📝 `packages/better-auth/src/api/routes/session.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/open-api/__snapshots__/open-api.test.ts.snap` (+8 -4) 📝 `packages/better-auth/src/plugins/open-api/open-api.test.ts` (+14 -0) </details> ### 📄 Description Fixes #8367 Updates `/get-session` 200 response schema to OAS 3.1 null union (`type: ["object", "null"]`) and removes deprecated `nullable` usage for that endpoint. Adds a regression test and updates the OpenAPI snapshot. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes POST /get-session 200 response schema for OpenAPI 3.1 by replacing deprecated nullable with a union type. Ensures clients and tooling correctly handle null responses per Linear #8367. - **Bug Fixes** - Use type ["object", "null"] instead of nullable: true for the 200 schema. - Add changeset for `better-auth` patch release. - Add a test asserting the union type and absence of nullable on /get-session, and update the OpenAPI snapshot. <sup>Written for commit cd570d433695988d5ad9f6fad19a575e6274c339. Summary will update 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-04-15 22:35:09 -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#24842