Skip to content
Open
Changes from all commits
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
6 changes: 4 additions & 2 deletions src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,10 @@ export function toOpenAPISchema(
// @ts-ignore
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-expect-error - getFlattenedRoutes is a protected method not in public types
const routes = app.getFlattenedRoutes?.() ?? app.getGlobalRoutes()

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