diff --git a/packages/trpc-panel/src/parse/parseProcedure.ts b/packages/trpc-panel/src/parse/parseProcedure.ts index b77c810..d2a5a55 100644 --- a/packages/trpc-panel/src/parse/parseProcedure.ts +++ b/packages/trpc-panel/src/parse/parseProcedure.ts @@ -68,6 +68,7 @@ function nodeAndInputSchemaFromInputs( schema: zodToJsonSchema(emptyZodObject, { errorMessages: true, $refStrategy: "none", + ...options.zodToJsonSchema, }), node: inputParserMap["zod"](emptyZodObject, { path: [], @@ -90,6 +91,7 @@ function nodeAndInputSchemaFromInputs( schema: zodToJsonSchema(input as any, { errorMessages: true, $refStrategy: "none", + ...options.zodToJsonSchema, }), // node: zodSelectorFunction((input as any)._def, { path: [], diff --git a/packages/trpc-panel/src/parse/parseRouter.ts b/packages/trpc-panel/src/parse/parseRouter.ts index 4dfa596..f24dfed 100644 --- a/packages/trpc-panel/src/parse/parseRouter.ts +++ b/packages/trpc-panel/src/parse/parseRouter.ts @@ -4,6 +4,7 @@ import { Router as TRPCRouter } from "@trpc/server"; import { zodToJsonSchema } from "zod-to-json-schema"; import { logParseError } from "./parseErrorLogs"; import { ParsedProcedure, parseProcedure } from "./parseProcedure"; +import type { Options as ZodToJsonSchemaOptions } from "zod-to-json-schema/src/Options"; export type JSON7SchemaType = ReturnType; @@ -64,6 +65,7 @@ function parseRouter( export type TrpcPanelExtraOptions = { logFailedProcedureParse?: boolean; transformer?: "superjson"; + zodToJsonSchema?: Partial>; }; export function parseRouterWithOptions(