zto 0.1.0
zto: ^0.1.0 copied to clipboard
Annotation-based DTO validation and OpenAPI schema generation for Dart server-side.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2025-03-14 #
Added #
- Initial release
@Dtoclass annotation for DTOs- Field type annotations:
@ZString,@ZInt,@ZDouble,@ZNum,@ZBool,@ZDate,@ZFile,@ZEnum,@ZList,@ZListOf,@ZObj - String validators:
@ZMinLength,@ZMaxLength,@ZLength,@ZEmail,@ZUuid,@ZUrl,@ZPattern,@ZStartsWith,@ZEndsWith,@ZIncludes,@ZBase64,@ZHex,@ZIpv4,@ZIpv6,@ZHttpUrl,@ZJwt,@ZIsoDate,@ZIsoDateTime,@ZUppercase,@ZLowercase,@ZSlug,@ZAlphanumeric - Numeric validators:
@ZMin,@ZMax,@ZPositive,@ZNegative,@ZNonNegative,@ZNonPositive,@ZMultipleOf,@ZInteger,@ZFinite,@ZSafeInt @Nullable()modifier for optional fieldsZto.parse()andZto.parseList()for parsing mapsZtoDto.refine()for cross-field validationZtoExceptionwithtoMap(),format(), and configurableZto.errorFormatterDtoToOpenApi.convert()for OpenAPI 3.0 JSON Schema generation- Integration with
zto_generatorfor code generation - Build-time validation: incompatible validators (e.g.
@ZEmailon@ZDouble) fail the build with a clear error message