Creates a Data Transfer Object (DTO) class with a Zod schema for validation.

Zod raw shape or schema for the DTO.

A DTO class with validation.

  • Creates a Data Transfer Object (DTO) class with a Zod schema for validation.

    Type Parameters

    • T extends ZodType<{ [key: string]: any }, { [key: string]: any }>

    Parameters

    • schema: T

      Zod object schema for the DTO.

    Returns Class<z.TypeOf<T>>

    A DTO class with validation.

  • Creates a Data Transfer Object (DTO) class with a Zod schema for validation.

    Type Parameters

    • T extends ZodRawShape

    Parameters

    • shapeOrSchema: T

      Zod raw shape for the DTO.

    Returns Class<z.TypeOf<z.ZodObject<T>>>

    A DTO class with validation.