We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e831cf1 commit 2dedfccCopy full SHA for 2dedfcc
src/core/body.ts
@@ -1,6 +1,7 @@
1
import type { HttpMethod } from "~/types/http";
2
import type { FixedRequest } from "~/types/request";
3
import { resolveContent } from "./content";
4
+import { safeParse } from "./zod-error-handler";
5
import type { RequestBodyObject } from "@omer-x/openapi-types/request-body";
6
import type { ZodError, ZodType, ZodTypeDef } from "zod";
7
@@ -27,7 +28,7 @@ export async function parseRequestBody<I, O>(
27
28
...collection, [key]: formData.get(key),
29
}), {});
30
try {
- return schema.parse(body);
31
+ return safeParse(schema, body);
32
} catch (error) {
33
if (process.env.NODE_ENV !== "production") {
34
// eslint-disable-next-line no-console
0 commit comments