8000 v4: meta not kept when using `z.stringbool()` · Issue #4138 · colinhacks/zod · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
v4: meta not kept when using z.stringbool() #4138
Closed
@arthurvanl

Description

@arthurvanl

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0