Skip to content

Commit cd0fd41

Browse files
committed
fix(discord-ts): accept offset timestamps in generated zod validation
Configure the zod plugin with dates.offset so it emits z.iso.datetime({ offset: true }), allowing Discord's timestamps with timezone offsets (e.g. +00:00) to pass validation, not just `Z`.
1 parent 9f396d2 commit cd0fd41

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/discord-ts/openapi-ts.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ export default defineConfig({
3333
// Validate request bodies and responses at runtime using the generated Zod schemas.
3434
validator: "zod",
3535
},
36-
"zod",
36+
{
37+
name: "zod",
38+
dates: {
39+
// Emit z.iso.datetime({ offset: true }) so validation accepts Discord's
40+
// timestamps with timezone offsets (e.g. +00:00), not just `Z`.
41+
offset: true,
42+
},
43+
},
3744
],
3845
});

0 commit comments

Comments
 (0)