docs(zod-openapi): use tuple in middleware example (#812)

pull/819/head
oberbeck 2024-11-09 02:05:26 +01:00 committed by GitHub
parent 0ebcc6f276
commit 2f55c21d62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -285,7 +285,10 @@ const route = createRoute({
request: {
params: ParamsSchema,
},
middleware: [prettyJSON(), cache({ cacheName: 'my-cache' })],
middleware: [
prettyJSON(),
cache({ cacheName: 'my-cache' })
] as const, // Use `as const` to ensure TypeScript infers the middleware's Context.
responses: {
200: {
content: {