Skip to content

Commit

Permalink
fix: add integer condition in schemas validation
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinRouchut committed Aug 10, 2023
1 parent 615ae41 commit 412472c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";

export const shortMessageSchema = z.object({
id: z.number().safe().positive(),
id: z.number().int().safe().positive(),
from: z.string().email(),
subject: z.string(),
date: z.string().nonempty(),
Expand All @@ -10,7 +10,7 @@ export const shortMessageSchema = z.object({
export const attachmentSchema = z.object({
filename: z.string().nonempty(),
contentType: z.string().nonempty(),
size: z.number().safe().nonnegative(),
size: z.number().int().safe().nonnegative(),
});

export const messageSchema = shortMessageSchema.extend({
Expand Down

0 comments on commit 412472c

Please sign in to comment.