Skip to content

[Feature] Adding support for Zod schemas for dates with coerce option in the schema.zmodel file of the Zod plugin #824

@kpidoff

Description

@kpidoff

Description:
Currently, the Zod plugin does not support handling Zod schemas for dates with the coerce option in the schema.zmodel file. This feature would be very useful to simplify date validation when defining Zod schemas.

Request:
I would like to make a request to add the ability to handle Zod schemas for dates with the coerce option in the schema.zmodel file. The idea is to allow users to specify coerce: true when defining a date schema, which would make date validation and conversion easier.

Code Example:
Here is an example of what defining a date schema with the coerce option in the schema.zmodel file could look like:

plugin zod {
  provider = '@core/zod'
  output = 'src/lib/zod'
  compile = false
  modelOnly = true
  coerce = true
};

Impact:
This feature would enhance the flexibility and user-friendliness of the Zod plugin by enabling developers to more easily manage date schemas with a coerce option.

Thank you for considering this request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions