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 3ccbccd commit c974abeCopy full SHA for c974abe
src/api/plugins/validate.ts
@@ -16,7 +16,7 @@ const zodValidationPlugin: FastifyPluginAsync = async (fastify, _options) => {
16
zodSchema: z.ZodTypeAny,
17
): Promise<void> {
18
try {
19
- await zodSchema.parseAsync(request.body);
+ await zodSchema.parseAsync(request.body || {});
20
} catch (e: unknown) {
21
if (e instanceof ZodError) {
22
throw new ValidationError({
0 commit comments