dox_validation 3.0.0-alpha.5
dox_validation: ^3.0.0-alpha.5 copied to clipboard
Typed input for Dart. DTO classes with generated checks, fluent schemas like Zod, JSON Schema export and the Standard Schema interface.
3.0.0-alpha.5 #
- Version bump only, to match the other packages.
3.0.0-alpha.4 #
- Version bump only, to match the other packages.
3.0.0-alpha.3 #
- Version bump only, to match the other packages.
3.0.0-alpha.2 #
- A JSON body that is not an object now says
The request body must be a JSON object.(key_root). Change it with the message key_root.object. - Needs Dart 3.13 or newer.
- All dependencies updated to their latest versions.
- New: DTOs. A class with
@Dto()and rule annotations (@Length,@Email,@Min,@Regex,@MaxSize, ...).dox_builderwrites aconst DtoSchema<T>with the checks, a converter and the JSON Schema. See the Validation guide. - New:
DtoSchema<T>withvalidateMap,safeValidateMap,fromMap,toMapandtoJsonSchema. It is also aSchema<T>. - New:
Maybe<T>knows a missing key fromnull.DtoErrorsfor checks across fields invalidate(). - New:
FileTypesfinds the real type of a file from its first bytes.@Image()andv.file().image()do not allowsvg. - New:
MessageRequest.locale,ParseState.params. A message set on a rule is used as it is; the resolver only fills its placeholders. Rulehas aconstconstructor and afinalmessage, so a rule class works as an annotation.AsyncRule.failedItems()checks a list in one call.FileInputhaslengthandhead(the first bytes).Schemahas aconstconstructor. The fluent schemas extendBaseSchema.- Text length messages say "characters".
- Breaking: removed
v.fromRules(),v.registerRule(),RuleRegistry,RuleDefinition,CallbackRuleand all rule strings. Use a DTO, or aRule<T>class.
3.0.0-alpha.1 #
- First release of
dox_validation. - Fluent schema builder: string, int, num, bool, date, enum, literal, list, object, map, union, any, file.
optional,nullable,nullish,defaultTo,transform,refine,superRefine, async refinements.- Coercion with
v.coercefor query strings and form data. parse,safeParse,parseAsync,safeParseAsyncwith issue paths.- Standard Schema interface (
StandardSchema). - JSON Schema (draft 2020-12 / OpenAPI 3.1) export with
toJsonSchema(). - Custom
Ruleclasses and a globalMessageResolver. - Laravel style string rules with
v.fromRules().