@@ -8,6 +8,7 @@ import { verifyOptions } from "./options";
8
8
import { type RouteRecord , bundlePaths , createRouteRecord } from "./route" ;
9
9
import { bundleSchemas } from "./schema" ;
10
10
import type { OpenApiDocument } from "@omer-x/openapi-types" ;
11
+ import type { ComponentsObject } from "@omer-x/openapi-types/components" ;
11
12
import type { ServerObject } from "@omer-x/openapi-types/server" ;
12
13
import type { ZodType } from "zod" ;
13
14
@@ -17,6 +18,7 @@ type GeneratorOptions = {
17
18
routeDefinerName ?: string ,
18
19
rootPath ?: string ,
19
20
servers ?: ServerObject [ ] ,
21
+ securitySchemes ?: ComponentsObject [ "securitySchemes" ] ,
20
22
} ;
21
23
22
24
export default async function generateOpenApiSpec ( schemas : Record < string , ZodType > , {
@@ -25,6 +27,7 @@ export default async function generateOpenApiSpec(schemas: Record<string, ZodTyp
25
27
routeDefinerName = "defineRoute" ,
26
28
rootPath : additionalRootPath ,
27
29
servers,
30
+ securitySchemes,
28
31
} : GeneratorOptions = { } ) {
29
32
const verifiedOptions = verifyOptions ( includeOption , excludeOption ) ;
30
33
const appFolderPath = await findAppFolderPath ( ) ;
@@ -53,6 +56,7 @@ export default async function generateOpenApiSpec(schemas: Record<string, ZodTyp
53
56
paths : bundlePaths ( validRoutes , schemas ) ,
54
57
components : {
55
58
schemas : bundleSchemas ( schemas ) ,
59
+ securitySchemes,
56
60
} ,
57
61
} ;
58
62
0 commit comments