dox_validation 3.0.0
dox_validation: ^3.0.0 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 #
- The first stable release.
- The package now lives in its own repo: dartondox/dox-validation. Nothing changes for users: same package name, same API.
3.0.0-rc.1 #
- Version bump only, to match the other packages.
3.0.0-alpha.17 #
- Version bump only, to match the other packages.
3.0.0-alpha.16 #
- Version bump only, to match the other packages.
3.0.0-alpha.15 #
- Version bump only, to match the other packages.
3.0.0-alpha.14 #
- Version bump only, to match the other packages.
3.0.0-alpha.13 #
- Version bump only, to match the other packages.
3.0.0-alpha.12 #
- Version bump only, to match the other packages.
3.0.0-alpha.11 #
- Version bump only, to match the other packages.
3.0.0-alpha.10 #
- Version bump only, to match the other packages.
3.0.0-alpha.9 #
- Version bump only, to match the other packages.
3.0.0-alpha.8 #
- Fix:
FileTypes.sniffread any data that starts withBMasbmp, like the text "BMW...". Now it also checks the BMP header size at byte 14 (12, 40, 52, 56, 64, 108 or 124).
3.0.0-alpha.7 #
- Perf: object, list, map and union schemas work out
isAsynconce and keep the answer. Before, the whole schema tree was walked on everyvalidateSchemacall. url()now allows onlyhttpandhttpslinks. Passschemesto allow others.- File type checks now also need the file name extension to fit the bytes. A
.htmlfile with GIF bytes no longer passes@Image. Only another known type (like.pngwith GIF bytes) or a type the browser runs (html,htm,xhtml,svg,xml,js,mjs) is refused. A file with no or an unknown extension (like a canvas upload namedblob) passes when the bytes match.
3.0.0-alpha.6 #
- Version bump only, to match the other packages.
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().