Closed
Description
Minimal reproduction:
export const _userSchema = z.interface({
daily_1: z.string().meta({description: 'oke', primary: true}),
d: z.email()
// daily_report_mail: z.stringbool(({truthy: ['1', 'true'], falsy: ['0', 'false']})).meta({title: 'asdasdasd',description: 'Whether this user should receive daily csv report emails', examples: [false]}),
})
console.dir(z.toJSONSchema(_userSchema), {depth: 4})
Version: ^4.0.0-beta.20250412T085909
Method | Meta Kept | Info |
---|---|---|
z.string() |
✅ | |
z.email() |
✅ | |
z.int() |
✅ | |
z.number() |
✅ | |
z.boolean() |
✅ | |
z.bigint() |
Couldn't be tested in objects, so I dont feel like using | |
z.undefined() |
✅ | |
z.symbol() |
Couldn't be tested in objects, so I dont feel like using | |
z.null() |
✅ | |
z.coerce.string() |
✅ | |
z.coerce.number() |
✅ | |
z.coerce.boolean() |
✅ | |
z.literal() |
✅ | |
z.templateLiteral() |
✅ | |
z.stringbool() |
❌ | |
z.optional(z.stringbool()).meta({description: 'oke'}) |
✅ | |
z.optional(z.stringbool().meta({description: 'oke'})) |
❌ |
Metadata
Metadata
Assignees
Labels
No labels