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

Open
opened 2026-03-13 13:53:58 -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: 🔄 Open

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


📝 Commits (3)

  • 1d92ed7 fix(open-api): correct get-session nullable schema for OAS 3.1
  • 66150f7 Merge branch 'canary' into fix/oas-3-1-get-session-8367
  • b801eef chore(ci): retrigger flaky test run

📊 Changes

3 files changed (+24 additions, -6 deletions)

View changed files

📝 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 a test that asserts the union type and absence of nullable on /get-session.
    • Update the OpenAPI snapshot.

Written for commit b801eef3f9f06c9f9f262cc696d7d54c34dcad35. 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:** 🔄 Open **Base:** `canary` ← **Head:** `fix/oas-3-1-get-session-8367` --- ### 📝 Commits (3) - [`1d92ed7`](https://github.com/better-auth/better-auth/commit/1d92ed7f1a4fd3ba7667a942a337213953fbeb20) fix(open-api): correct get-session nullable schema for OAS 3.1 - [`66150f7`](https://github.com/better-auth/better-auth/commit/66150f76a018a3bd13c4f45e97ea76260b32cfdf) Merge branch 'canary' into fix/oas-3-1-get-session-8367 - [`b801eef`](https://github.com/better-auth/better-auth/commit/b801eef3f9f06c9f9f262cc696d7d54c34dcad35) chore(ci): retrigger flaky test run ### 📊 Changes **3 files changed** (+24 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `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 a test that asserts the union type and absence of nullable on /get-session. - Update the OpenAPI snapshot. <sup>Written for commit b801eef3f9f06c9f9f262cc696d7d54c34dcad35. 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-03-13 13:53:58 -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#7942