@@ -8,6 +8,7 @@ import { verifyOptions } from "./options";
88import { type RouteRecord , bundlePaths , createRouteRecord } from "./route" ;
99import { bundleSchemas } from "./schema" ;
1010import type { OpenApiDocument } from "@omer-x/openapi-types" ;
11+ import type { ComponentsObject } from "@omer-x/openapi-types/components" ;
1112import type { ServerObject } from "@omer-x/openapi-types/server" ;
1213import type { ZodType } from "zod" ;
1314
@@ -17,6 +18,7 @@ type GeneratorOptions = {
1718 routeDefinerName ?: string ,
1819 rootPath ?: string ,
1920 servers ?: ServerObject [ ] ,
21+ securitySchemes ?: ComponentsObject [ "securitySchemes" ] ,
2022} ;
2123
2224export default async function generateOpenApiSpec ( schemas : Record < string , ZodType > , {
@@ -25,6 +27,7 @@ export default async function generateOpenApiSpec(schemas: Record<string, ZodTyp
2527 routeDefinerName = "defineRoute" ,
2628 rootPath : additionalRootPath ,
2729 servers,
30+ securitySchemes,
2831} : GeneratorOptions = { } ) {
2932 const verifiedOptions = verifyOptions ( includeOption , excludeOption ) ;
3033 const appFolderPath = await findAppFolderPath ( ) ;
@@ -53,6 +56,7 @@ export default async function generateOpenApiSpec(schemas: Record<string, ZodTyp
5356 paths : bundlePaths ( validRoutes , schemas ) ,
5457 components : {
5558 schemas : bundleSchemas ( schemas ) ,
59+ securitySchemes,
5660 } ,
5761 } ;
5862
0 commit comments