@@ -7,6 +7,7 @@ import { resolveParams } from "./params";
7
7
import parsePathParams from "./path-params" ;
8
8
import { addBadRequest , bundleResponses } from "./responses" ;
9
9
import parseSearchParams from "./search-params" ;
10
+ import type { OperationObject } from "@omer-x/openapi-types/operation" ;
10
11
import type { ZodIssue , ZodType , ZodTypeDef } from "zod" ;
11
12
12
13
type ActionSource < PathParams , QueryParams , RequestBody > = {
@@ -57,6 +58,7 @@ type RouteOptions<
57
58
middleware ?: (
58
59
hander : RouteMethodHandler < PathParamsInput , Req , Res >
59
60
) => RouteMethodHandler < PathParamsInput , Req , Res > ,
61
+ security ?: OperationObject [ "security" ] ,
60
62
} & ( RouteWithBody < RequestBodyInput , RequestBodyOutput > | RouteWithoutBody ) ;
61
63
62
64
function defineRoute <
@@ -125,6 +127,7 @@ function defineRoute<
125
127
parameters : parameters . length ? parameters : undefined ,
126
128
requestBody : resolveRequestBody ( input . requestBody ?? undefined , input . hasFormData ) ,
127
129
responses : responses ,
130
+ security : input . security ,
128
131
} ;
129
132
130
133
if ( input . middleware ) {
0 commit comments