Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ export function toOpenAPISchema(
const definitions = app.getGlobalDefinitions?.().type

// @ts-ignore private property
const routes = app.getGlobalRoutes()
// Use getFlattenedRoutes() if available (Elysia 1.4.16+) to get guard() schemas
// Falls back to getGlobalRoutes() for older versions
// @ts-ignore
const routes = app.getFlattenedRoutes?.() ?? app.getGlobalRoutes()

if (references) {
if (!Array.isArray(references)) references = [references]
Expand Down