From 97bc092aea72dce19f5d1626054ecae69cf01aac Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Fri, 29 Aug 2025 19:14:27 +0200 Subject: [PATCH] fix(api): document generation not working with nextjs (#3920) --- package.json | 3 ++- patches/trpc-to-openapi.patch | 13 +++++++++++++ pnpm-lock.yaml | 7 +++++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 patches/trpc-to-openapi.patch diff --git a/package.json b/package.json index a574a3918..4bb9d7aba 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,8 @@ "proxmox-api>undici": "7.14.0" }, "patchedDependencies": { - "@types/node-unifi": "patches/@types__node-unifi.patch" + "@types/node-unifi": "patches/@types__node-unifi.patch", + "trpc-to-openapi": "patches/trpc-to-openapi.patch" }, "allowUnusedPatches": true, "ignoredBuiltDependencies": [ diff --git a/patches/trpc-to-openapi.patch b/patches/trpc-to-openapi.patch new file mode 100644 index 000000000..6542bcddb --- /dev/null +++ b/patches/trpc-to-openapi.patch @@ -0,0 +1,13 @@ +diff --git a/dist/esm/utils/zod.mjs b/dist/esm/utils/zod.mjs +index a3fda1a5b5403a659bfc70653a94102e607f8b80..070d9728f9b41add50e5d30d3aa559be91018ccd 100644 +--- a/dist/esm/utils/zod.mjs ++++ b/dist/esm/utils/zod.mjs +@@ -62,7 +62,7 @@ export const instanceofZodTypeLikeString = (_type) => { + } + return instanceofZodTypeKind(type, 'string'); + }; +-export const zodSupportsCoerce = 'coerce' in z; ++export const zodSupportsCoerce = true //'coerce' in z; + export const instanceofZodTypeCoercible = (_type) => { + const type = unwrapZodType(_type, false); + return (instanceofZodTypeKind(type, 'number') || diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60e4227ec..38237721b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ patchedDependencies: '@types/node-unifi': hash: 5e6ae51e2a17a7f9729bfa30b0eb3d0842a5810ac6db47603ab4a6efa1ed84c5 path: patches/@types__node-unifi.patch + trpc-to-openapi: + hash: 2ca3c16af0fcca0c736697ad4fe553a14f794524fa9ce0d5c3e8ee4aea76090c + path: patches/trpc-to-openapi.patch importers: @@ -634,7 +637,7 @@ importers: version: 2.2.2 trpc-to-openapi: specifier: ^3.0.1 - version: 3.0.1(@trpc/server@11.4.4(typescript@5.9.2))(zod-openapi@5.3.0(zod@4.0.17))(zod@4.0.17) + version: 3.0.1(patch_hash=2ca3c16af0fcca0c736697ad4fe553a14f794524fa9ce0d5c3e8ee4aea76090c)(@trpc/server@11.4.4(typescript@5.9.2))(zod-openapi@5.3.0(zod@4.0.17))(zod@4.0.17) zod: specifier: ^4.0.17 version: 4.0.17 @@ -19979,7 +19982,7 @@ snapshots: trough@2.2.0: {} - trpc-to-openapi@3.0.1(@trpc/server@11.4.4(typescript@5.9.2))(zod-openapi@5.3.0(zod@4.0.17))(zod@4.0.17): + trpc-to-openapi@3.0.1(patch_hash=2ca3c16af0fcca0c736697ad4fe553a14f794524fa9ce0d5c3e8ee4aea76090c)(@trpc/server@11.4.4(typescript@5.9.2))(zod-openapi@5.3.0(zod@4.0.17))(zod@4.0.17): dependencies: '@trpc/server': 11.4.4(typescript@5.9.2) co-body: 6.2.0