From a11b939b533972756b0fcdd8f9e163dd80e63e09 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 1 Dec 2023 20:50:56 -0600 Subject: [PATCH] fix typo in #224. why don't we lint the generated code???? --- client/msw-handlers.ts | 2 +- generator/client/msw-handlers.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/msw-handlers.ts b/client/msw-handlers.ts index be337b7..68dc0bb 100644 --- a/client/msw-handlers.ts +++ b/client/msw-handlers.ts @@ -1079,7 +1079,7 @@ const handler = let body = undefined; if (bodySchema) { const rawBody = await req.json(); - const result = bodySchema.transform(snakeify).safeParse(body); + const result = bodySchema.transform(snakeify).safeParse(rawBody); if (!result.success) return json(result.error.issues, { status: 400 }); body = result.data; } diff --git a/generator/client/msw-handlers.ts b/generator/client/msw-handlers.ts index 4822724..54731ef 100644 --- a/generator/client/msw-handlers.ts +++ b/generator/client/msw-handlers.ts @@ -164,7 +164,7 @@ export function generateMSWHandlers(spec: OpenAPIV3.Document) { let body = undefined if (bodySchema) { const rawBody = await req.json() - const result = bodySchema.transform(snakeify).safeParse(body); + const result = bodySchema.transform(snakeify).safeParse(rawBody); if (!result.success) return json(result.error.issues, { status: 400 }) body = result.data }