Skip to content

Commit 5ab9c31

Browse files
committed
feat: securitySchemes option
1 parent f4b7a86 commit 5ab9c31

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/generateOpenApiSpec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { verifyOptions } from "./options";
88
import { type RouteRecord, bundlePaths, createRouteRecord } from "./route";
99
import { bundleSchemas } from "./schema";
1010
import type { OpenApiDocument } from "@omer-x/openapi-types";
11+
import type { ComponentsObject } from "@omer-x/openapi-types/components";
1112
import type { ServerObject } from "@omer-x/openapi-types/server";
1213
import 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

2224
export 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

Comments
 (0)