Skip to content

Allow extending other swaggers #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Lindsor opened this issue Apr 14, 2025 · 1 comment
Open

Allow extending other swaggers #204

Lindsor opened this issue Apr 14, 2025 · 1 comment

Comments

@Lindsor
Copy link

Lindsor commented Apr 14, 2025

When using an integration like better-auth, even though they support OpenAPI specs it doesn't get added to the swagger output of Elysia. One workaround could be to allow the swagger plugin to be extended with other swagger definitions so we can add any custom paths to the single swagger definition.

import swagger from '@elysiajs/swagger';

import { auth } from './better-auth/auth';

const betterAuthSwagger = await auth.api.generateOpenAPISchema();

const app = new Elysia()
  .use(swagger({
    extends: [
      betterAuthSwagger,
    ],
  }));
@emirefek
Copy link

emirefek commented Apr 17, 2025

Also curious about same thing. ElysiaJS have official docs about how to integrate better-auth to elysia but their docs are not showed on swagger. Could we improve that situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants