missing 'version' attribute in the openapi schema #516

Closed
opened 2026-03-13 07:50:35 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @dum3ng on GitHub (Jan 3, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

import { openAPI } from 'better-auth/plugins'
auth=  betterAuth({
  secret: process.env.BETTER_AUTH_SECRET,
  plugins: [openAPI()],})

const authApiSchema = await auth.api.generateOpenAPISchema()
console.log(authApiSchema)

Current vs. Expected behavior

current there is not version in the info field, which make the openapi generator to fail because schema validation, and it is harder to find this out when using a tool wrapper around openapi generator.

"openapi": "3.1.1",
  "info": {
    "title": "Better Auth",
    "description": "API Reference for your Better Auth Instance"
  },

What version of Better Auth are you using?

1.0.22

Provide environment information

- os: macos 14.4.1 (23E224)

Which area(s) are affected? (Select all that apply)

Client

Auth config (if applicable)

import { betterAuth } from "better-auth"
import { openAPI } from 'better-auth/plugins'

auth=  betterAuth({
  secret: process.env.BETTER_AUTH_SECRET,
  plugins: [openAPI()],})

Additional context

No response

Originally created by @dum3ng on GitHub (Jan 3, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce ``` import { openAPI } from 'better-auth/plugins' auth= betterAuth({ secret: process.env.BETTER_AUTH_SECRET, plugins: [openAPI()],}) const authApiSchema = await auth.api.generateOpenAPISchema() console.log(authApiSchema) ``` ### Current vs. Expected behavior current there is not `version` in the `info` field, which make the openapi generator to fail because schema validation, and it is harder to find this out when using a tool wrapper around openapi generator. ``` "openapi": "3.1.1", "info": { "title": "Better Auth", "description": "API Reference for your Better Auth Instance" }, ``` ### What version of Better Auth are you using? 1.0.22 ### Provide environment information ```bash - os: macos 14.4.1 (23E224) ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" import { openAPI } from 'better-auth/plugins' auth= betterAuth({ secret: process.env.BETTER_AUTH_SECRET, plugins: [openAPI()],}) ``` ### Additional context _No response_
GiteaMirror added the bug label 2026-03-13 07:50:35 -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#516