ZenStack plugin and decorator package that auto-generates DTOs with class-validator and class-transformer decorators from ZModel schemas. Version 1.0.1, active development. Key differentiator: seamless integration with ZenStack and NestJS ecosystems, filling gaps in class-validator with custom decorators like @Gt, @Lt, @Trim, and @LowerCase. Provides both a generator plugin for build-time and runtime decorators.
npm install zenstack-validatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Generate DTOs from ZModel schema using the zenstack-validator plugin, then use them in a NestJS controller for validation.
Use provider = 'zenstack-validator/plugin' in schema.zmodel.
Use import { UserDTO } from './dto/dtos'; not import UserDTO from './dto/dtos';.Use import statements and ensure your project is ESM or use dynamic import().
Consider importing @Transform(({ value }) => value.trim()) directly from class-transformer instead.Run npm install zenstack-validator and ensure tsconfig.json includes node_modules types.
Change provider to 'zenstack-validator/plugin'.
Use import { UserDTO } from './dto/dtos'; instead of import UserDTO from './dto/dtos';.