Skip to content

Commit 07fd14f

Browse files
committed
feat(openapi): parse the spec once, use that for the hosted service
1 parent 06b809e commit 07fd14f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/openapi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export async function openApi<
8686
};
8787

8888
const defaultOptions: OAPIOpts = {
89-
apiSpec,
89+
apiSpec: app.locals.openApiSpecification,
9090
ignoreUndocumented: true,
9191
validateRequests: {
9292
allowUnknownQueryParameters: true,
@@ -146,5 +146,6 @@ export async function openApi<
146146
...(typeof routing.openapi === 'object' ? routing.openapi : {}),
147147
...openApiOptions,
148148
};
149+
149150
return OpenApiValidator.middleware(_.defaultsDeep(defaultOptions, combinedOptions));
150151
}

0 commit comments

Comments
 (0)