Changelog
All notable changes to vld and its integration crates.
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.9.0 - 2026-11-21
Breaking changes
- Translations moved to JSON catalogs read through i18n-next (feature
i18n, embedding en, ru, de, es;i18n-<lang>adds one of 25 more languages,i18n-allall 29 — only enabled catalogs are compiled in). Removed:vld::i18n::russian(),german(),spanish()andplural_ru(their texts are nowlocales/{ru,de,es}.json). Migration: enablevld/i18nand replacetranslate_error(&err, &russian())withtranslate_error(&err, &vld::i18n::translator("ru")); aMapResolverwith your own Russian_few/_manykeys takes your own rule inwith_plural_rule(fn(u64) -> &'static str). Two Russian / Ukrainian / Czech / Polish texts changed with the move:range_orderkeeps the field names in backticks, andtype.duration/type.file(also German, Spanish) list the accepted forms like English.MessageResolvergainedresolve_count(key, n)(default: the old<key>_<category>lookup, so existing resolvers keep working).
Added
- Feature
i18n(dependencyi18n-next0.2, no default features): error messages in 29 languages (ar, bg, cs, da, de, el, en, es, fi, fr, he, hi, hu, id, it, ja, ko, nb, nl, pl, pt, ro, ru, sv, th, tr, uk, vi, zh) from JSON catalogs;i18nembeds en, ru, de, es, eachi18n-<lang>feature one more,i18n-allall of them;vld::i18n::translator(locale)with the fallback chainpt-BR→pt→enand CLDR plural forms for every language;Translator::new(view)over an app's own i18n-next catalog (built with.extend(vld::i18n::files()): the app overrides anyvld.*key, adds a language, translates its custom codes asvld.<code>);files(),catalog(locale),locales(),supported_locale(tag)to ship the same files to a frontend (Vue / React via@i18n-micro, Leptos, a Tauri WebView). The default English messages are read fromlocales/en.json(no dependency without the feature; unchanged text). Guide: Translations. decimal()scale and precision:max_scale(n)/scale(n)(digits after the point as written, trailing zeros count) andmax_precision(p); issuestoo_big/invalid_lengthwith the new originsscale/precision;ZDecimal::with_messages; JSON Schemax-maxScale/x-scale/x-maxPrecision, honoured byvld::fake. Guide: decimal.vld::money()(featuredecimal):{amount, currency}intoMoney { amount: Decimal, currency: String }, the amount's scale checked against the currency's ISO 4217 minor units (USD 2, JPY 0, BHD 3);.amount(..),.currencies(..).DecimalandMoneyimplementVldType. Guide: money.- Feature
geo(no dependencies):vld::latitude(),vld::longitude(),vld::geo_point()({lat, lng}or GeoJSON-order[lng, lat]intoGeoPoint) andvld::geojson()(RFC 7946 geometries,.types(..)for Features / FeatureCollections, every issue at its exact path; new issuering_not_closed). Guide: geo. - Number presets
vld::percent()(0..=100) andvld::ratio()(0..=1). - Unix timestamps on every date backend:
datetime().unix_seconds()/.unix_millis()(integers, numeric strings with.coerce()), bounds and past / future as usual; JSON Schematype: integerwithformat: unix-time/unix-time-msand the range. Guide: Unix timestamps. duration()accepts full ISO 8601 durations:P2W,P3DT4H30M,PT1.5H(fraction on the last part); years and months are refused withinvalid_format(duration_calendar_unit) as they have no fixed length.vld::range(item): an ordered{start, end}pair (.keys(..)to rename) intoRangeInclusive<T>for any ordered output (dates of every backend, numbers, decimals, durations); new issuerange_orderat the end field. Guide: date ranges.vld::crypto(featurecrypto): cryptocurrency wallet addresses with real encoding, checksum, version / prefix and length rules: Bitcoin (Base58Check, SegWit bech32, Taproot bech32m), Litecoin, Dogecoin, Bitcoin Cash (CashAddr and legacy), Ethereum / EVM (EIP-55), TRON, Solana, XRP, Cardano Shelley (CIP-19), Cosmos-SDK (any hrp), Polkadot / Kusama / Substrate (SS58, any prefix), TON (user-friendly and raw), Monero (standard, integrated, subaddress).string().crypto_address(network)/crypto_address_any([...]), typedvld::crypto::address(network)→CryptoAddress { network, kind, testnet, normalized, payload }, optionsmainnet()/testnet()/kinds(..)/checksummed(), and user templatesCryptoNetwork::custom(name)from Base58 / Base58Check / bech32 / bech32m / hex / base64 encodings and SHA-256d / keccak / EIP-55 / SS58 / CRC16 / CRC32 checksums. Issueinvalid_crypto_addresswithnetworkandreason; JSON Schemaformat: crypto-address+x-network+pattern;vld::fakegenerates valid addresses. Guide: crypto addresses.vld_app::env(featuresenv,dotenv): validated config from environment variables (from_env,from_env_prefixed,from_vars,from_vars_prefixed) and.envfiles via dotenvy (from_dotenv,read_dotenv); a prefix is stripped,__nests, values are coerced by the schema, and errors name the variable (VldEnvError). Guide: env.vld::schema::coerce_text: the lossless text → JSON coercion ("42"→42,"01234"stays text) for query strings, forms, headers and env vars, moved fromvld_web::common::coerce_value(now a re-export of it).vld_web::async_graphql(featureasync-graphql, async-graphql 7, Rust 1.89):VldValidator<S>for#[graphql(validator(custom = ...))],validate::<S, T>for resolvers andvld_error; issues in the error'sextensions.issueswith the HTTP issue shape. Guide: async-graphql.vld_web::tungstenite(featuretungstenite, tungstenite 0.26 – 0.30; serves tokio-tungstenite / async-tungstenite) andvld_web::axum::ws(featureaxum-ws):decode/encode/error_messagefor WebSocket messages, the error frame carrying the HTTP 422 body. Guide: WebSocket.vld_web::lambda(featurelambda,lambda_http1):validate_json,validate_query,validate_path,error_responsefor API Gateway / ALB requests,validate_event/event_errorfor rawlambda_runtimeevents. Guide: AWS Lambda.- vld-data:
vld_data::bson2/bson3(featuresbson-2/bson-3):to_document,from_document,validate_document,validate_documentsfor MongoDB documents, validated as relaxed Extended JSON (MongoDB);vld_data::postgres_types(featuretokio-postgres, postgres-types 0.2):Validated<S, T>JSON / JSONB andVldText/VldInt/VldFloat/VldBoolcolumns implementingToSql/FromSql, validated when built and when read (tokio-postgres);vld_data::clickhouse(featureclickhouse, clickhouse 0.15, Rust 1.89):insert_validated,fetch_all_validated,validate_rows(ClickHouse);vld_data::rumqttc(featurerumqttc, rumqttc 0.25):publish,try_publish,decode_publish(MQTT);vld_data::nats(featurenats, async-nats 0.53, Rust 1.89):publish,request(validated both ways),respond,decode(NATS);vld_data::centrifuge(featurecentrifuge, centrifuge-client 0.1):publish,client_publish,rpc,decode_publication,decode_rpc(Centrifugo). vld_data::socketio(featuresocketio, socketio-next 0.2, default features off):emit,emit_with_ack(request and ack reply validated), handler wrappersvalidated/validated_or(theonhandler runs only with a valid first argument; invalid data is logged or goes to your callback) andanswer/answer_or(server callbacks acked with a validated return value),ack,decode/decode_arg/decode_args,VldSocketIoError(Socket.IO).vld_data::csv(featurecsv, csv 1):rows(an iterator ofResult<T, RowError>) andvalidate_all(every row, or every failing row) read CSV records into vld types; the header row names the fields, cells are coerced like query strings, andRowErrorcarries the record's line, its cells and theVldErrororcsv::Error. Guide: CSV import.vld_openapi::poem_openapi(featurepoem-openapi, poem-openapi 5):impl_type!implements poem-openapiType/ParseFromJSONfor a vld type (the OpenAPI component fromjson_schema(), nested types included, validation on parse);VldJson<T>is a request body answering 422 with every issue (thevld_webbody);json_schema_to_meta,validation_error. Guide: poem-openapi.vld::llm(featurellm, no dependencies):T::llm_schema(provider)/schema.llm_schema(provider)/llm_schema(&json, provider)prepare a JSON Schema for OpenAI strict structured outputs, Anthropic strict tools, GeminiresponseSchemaor plain draft 2020-12 (Provider::Generic): nested types in$defs(recursion as$ref: "#"),oneOf→anyOf, nullableanyOf→ type arrays, every property required and optional ones nullable plusadditionalProperties: falsefor OpenAI, keywords and formats a provider rejects moved intodescriptionas text, and provider limits (depth, property / enum counts, recursion, optional / union parameters) checked up front (LlmSchemaError).parse_llm::<T>/parse_llm_with/extract_jsonread the JSON out of a model reply (raw, fenced, inside prose);VldError::llm_feedback()/llm_feedback_with(LlmFeedbackOptions)/llm_feedback_json()render issues aspath: expected <rule>, got <value>lines (issue limit, retry prompt, allowed-key hints, redaction kept). Guide: LLM structured outputs.vld_web::rmcp(featurermcp, rmcp 3.11, Rust 1.88):VldParameters<T>,parse_args,input_schema::<T>()andVldToolError(IntoCallToolResult): MCP tool arguments validated by vld, failures returned asisErrorresults with the feedback text and structured issues (SEP-1303). Guide: rmcp.vld_web::rig(featurerig, rig-core 0.47, Rust 1.97.1):VldToolHandler+VldTool<H>implement rig'sToolwithparameters()from vld (per provider) andinvalid_argsfeedback on bad arguments;parse_argsfor hand-written tools. Guide: rig.- Guide loco-rs:
vld_web::axumextractors in loco controllers, and rendering the rejection as loco'sErrorDetail(no new feature: loco handlers are axum handlers). - String formats with real tables and checksums:
country()/country_alpha3()(assigned ISO 3166-1 codes),iban()(registry length per country + mod-97),bic(),isbn()(ISBN-10 / ISBN-13 check digits),ean()(EAN-8 / UPC-A / EAN-13 / GTIN-14),vin()(North American check digit),timezone()(IANA name; checked against jiff's database withjiff, by shape without),mime(),object_id(),regex_syntax()(featureregex), each with its_msgtwin,StringValidationvariant,with_messageskey, JSON Schemaformat,vld::tscheck andvld::fakegenerator. Guide: strings. - Password rules on
string():require_lowercase(),require_uppercase(),require_digit(),require_symbol(),max_repeat(n), andpassword_strength(score)(featurepassword-strength, zxcvbn); oneinvalid_stringissue per failed rule (password_lowercase, …,password_repeatwithmax_repeat,password_strengthwithmin_score); JSON Schemaformat: password+x-password, honoured byvld::tsandvld::fake. Guide: passwords. VldSchema::redact()(ZRedact): every issue of the wrapped schema, nested ones included, getsreceived: "[redacted]"(vld::error::REDACTED), soDisplay,Debug, serialized errors, translations and HTTP bodies never echo the value; custom messages quoting an input string are scrubbed too. Guide: secrets in errors.- Feature
unicode:string().normalize_nfc()/normalize_nfkc()transforms and thesingle_script()check (Unicode TS #39 mixed-script spoofs). - Typed
vld::uuid()→uuid::Uuidandvld::url()→url::Url(featurestring-advanced,.checks(..)for extra string checks, JSON Schemaformat: uuid/uri);uuid::Uuidandurl::UrlimplementVldType.
Changed
string().currency_code()checks the ISO 4217 tablemoney()uses (active codes with minor units) instead of "three uppercase letters": withdrawn codes (HRK), metals and test codes (XAU,XTS) are now rejected.string().cron()parses the fields: values and ranges must be in range (minutes 0–59, hours 0–23, days 1–31, months 1–12 orJAN–DEC, weekdays 0–7 orSUN–SAT), steps are1..=max,?only in the day fields;@daily& co. are accepted. It used to accept any 5 or 6 fields of digits and*/,-?.- The
jifffeature enables jiff's time zone database (tzdb-bundle-platform,tzdb-zoneinfo) forstring().timezone().
Fixed
- vld-openapi validator and
list_properties: object keys in name order whatever map order serde_json uses; enablingserde_json/preserve_orderanywhere in a build (vld-databson-2does) changed issue order.
0.8.0 - 2026-11-21
Breaking changes
- The 30 crates are merged into six:
vld,vld-derive,vld-web,vld-openapi,vld-data,vld-app, released together with one version. Every integration is a public module of its group crate behind a feature, with the items of the former crate (VldJson, its error type,prelude, …). The 28 crates they replace are no longer developed (each gets a final 0.7.1 pointing to its new home). Guide: migration. - No default features in any crate: name what you use. Former defaults:
vld-ntex→ntex-4;vld-utoipa→utoipa-5;vld-schemars,vld-aide→schemars-0;vld-sqlx→sqlx-0_8+sqlite;vld-diesel→diesel+sqlite;vld-sea→sea-orm-1;vld-redis→redis-0;vld-lapin→lapin-2;vld-config→config-rs. - Majors are additive: each supported major of a dependency is its own feature and module (
ntex3/ntex4,utoipa5/utoipa6,schemars0/schemars1,sqlx08/sqlx09,sea1/sea2,redis0/redis1,lapin2/lapin3/lapin4), and any set can be enabled together; enabling two used to be a compile error. - Macros moved from the crate root to their module:
vld::ts::{impl_to_zod, impl_to_zod4, impl_to_valibot, impl_to_ts_type, impl_to_openapi}!,vld::fake::impl_fake!,vld::form::validate_args!,vld_openapi::utoipa5::impl_to_schema!/utoipa6::impl_to_schema!,vld_openapi::schemars0::{impl_json_schema, impl_vld_parse}!/schemars1::…,vld_web::tonic::impl_validate!,vld_data::sea1::impl_vld_before_save!/sea2::…,vld_data::surrealdb::validate_fields!. - Renamed features: vld-redis
aio/aio-tokio→redis-aio/redis-aio-tokio; vld-ntexcompress→ntex-compress. vld-http-common'sconformancefeature is removed (the suite is test-only invld-web). vld::form(former vld-leptos / vld-dioxus) has noprelude; import its items directly.- vld-lapin:
VldLapinErroris#[non_exhaustive]and has a new variantNotSettled.
Migration
| 0.7 crate | 0.8 crate + feature | Path |
|---|---|---|
vld-http-common | vld-web | vld_web::common |
vld-axum, vld-actix, vld-poem, vld-rocket, vld-salvo, vld-warp, vld-rama, vld-tower, vld-tonic | vld-web + <name> | vld_web::<name> |
vld-ntex | vld-web + ntex-3 / ntex-4 (+ ntex-compress) | vld_web::ntex3 / vld_web::ntex4 |
vld-utoipa | vld-openapi + utoipa-5 / utoipa-6 | vld_openapi::utoipa5 / utoipa6 |
vld-schemars, vld-aide | vld-openapi + schemars-0 / schemars-1 | vld_openapi::schemars0 / schemars1; validator: vld_openapi::validator (always on) |
vld-ts | vld + ts | vld::ts |
vld-fake | vld + fake | vld::fake |
vld-leptos, vld-dioxus | vld | vld::form |
vld-sqlx | vld-data + sqlx-0_8 / sqlx-0_9 + postgres / mysql / sqlite | vld_data::sqlx08 / sqlx09 |
vld-diesel | vld-data + diesel + postgres / mysql / sqlite | vld_data::diesel |
vld-sea | vld-data + sea-orm-1 / sea-orm-2 (+ with-*, postgres-array) | vld_data::sea1 / sea2 |
vld-surrealdb | vld-data | vld_data::surrealdb |
vld-redis | vld-data + redis-0 / redis-1 (+ redis-aio, redis-aio-tokio) | vld_data::redis0 / redis1 |
vld-lapin | vld-data + lapin-2 / lapin-3 / lapin-4 | vld_data::lapin2 / lapin3 / lapin4 |
vld-config | vld-app + config-rs / figment | vld_app::config |
vld-clap | vld-app + clap | vld_app::clap |
vld-tauri | vld-app | vld_app::tauri |
vld-integration-common | vld | vld::form, vld::error::{format_path, flatten_issues} |
Using both SQLx majors in one process: each maps SQLite ":memory:" to the same shared-cache name (sqlx-in-memory-0), so give in-memory databases distinct names.
Added
#[derive(Validate)]:T::validate_field(name, value)checks one field by its deserialize name without the rest of the object.#[derive(Validate)]honoursskip_serializing/skip_serializing_if:validate()accepts a serialized form without those keys.[T; N]implementsVldType(an array of exactlyNitems).- Numbers:
one_of(&[..])(invalid_enum_value, JSON Schemaenum), keeping the numeric output. - Strings:
min_bytes/max_bytes(UTF-8 bytes, originbytes) and thetruncate(n)transform.
Fixed
- A type-range failure (
u8()above 255,f32()overflow) now uses thewith_messagestext fortoo_small/too_big. number()checks whole numbers exactly:multiple_ofand bounds were judged inf64with a tolerance and accepted e.g.2^63as a multiple of 3.- Two
#[vld(...)]attributes on one field were silently reduced to the first; now a compile error. - vld-lapin on lapin 3 / 4: an ack / nack / reject that sends nothing (delivery already settled, channel closed) returned
Ok(false), which the helpers dropped, soack_decodereported success for an unacked message. They now returnVldLapinError::NotSettled. - vld-sea
with-time: time fractions are written in 3, 6 or 9 digits like chrono (12:30:05.500, was12:30:05.5), sotimeand chrono columns give the same text. number().multiple_of(..)is exact for whole numbers beyondi128too.array().unique()compares whole floats with integers by exact value at any magnitude (9.3e18and9300000000000000000are duplicates; floats at or above9.2e18were never equal to an integer).- Numbers in
contains,literaland discriminators compare by exact value:9007199254740993no longer equals9007199254740992.0(they were compared asf64). - vld-openapi validator:
const,enumanduniqueItemscompare numbers by value as JSON Schema requires (2equals2.0; it compared them as different). schema!: a serderenamecontaining escapes (rename = "a\"b") now gives the key serde uses (a"b); the escape text was kept verbatim.- A
unionwith a branch that accepts a missing key (optional(),with_default, …) is no longer listed in the object's JSON Schemarequired. - vld-schemars
to_openapi3: a null-only schema ({"type": ["null"]}, ananyOfof null branches) became{"nullable": true}, which allows any value; it now stays null-only. - vld-schemars validator:
multipleOfwith a fractional divisor accepted every value once the quotient passed ~1e9 (100000000.35for0.1); the tolerance is now 16 ulps. - vld-fake: field-name templates (e.g.
price) replaced records, strict empty objects and objects withpropertyNames/ property counts, so the fake failed its own schema; they apply to free-form objects only. - vld-fake: arrays of 2-tuples could stop short of
minItemswhen distinct keys ran out. - vld-ts Zod 4:
date-timeusedz.iso.datetime, which acceptsHH:MMand 10+ fraction digits and rejects lowercaset/z, unlike vld; it now uses the Zod 3 regex and calendar check, andtimegets a seconds regex.
0.7.0 - 2026-11-07
Breaking changes
- vld-tauri:
TauriIssuehas two new public fields,codeandparams; code that builds it with a struct literal must set them (deserializing old JSON still works, both default to empty).
Added
#[derive(Validate)]: a field without#[vld(...)]gets its type's default schema through the newvld::schema::VldTypetrait (String,bool, numbers,Option<T>,Vec<T>,HashSet<T>,HashMap/BTreeMap<String, T>,serde_json::Value, derived andschema!types as nested$refs). Tuple and newtype enum variants infer the same way.#[vld(dynamic)]on a derived struct or enum rebuilds its schemas on every parse, for limits read at runtime (non-generic types cache them once per process).vld::de:#[serde(deserialize_with = "vld::de::parse")]forVldParsefields andvld::deserialize_fn!(fn name -> T = <schema>)to validate while serde deserializes.- Numbers:
clamp()moves values outside the inclusive bounds onto them instead of failing; sized integers saturate to their type,f32to its finite range. VldSchema::blank_as(v):with_default(v)that also maps a blank string ("", whitespace).ZString::coerce_bools(on, off): coercion that writes booleans as e.g."1"/"0".- vld-tauri:
TauriIssuecarriescodeandparamsfor frontend translation (vue-i18n & co.). - vld-ts: Zod 4 output (
to_zod4,impl_to_zod4!,zod4_export) and plain TypeScript types (to_ts_type,impl_to_ts_type!,ts_type_export).
0.6.1 - 2026-11-07
Added
#[derive(Validate)]honours#[serde(deny_unknown_fields)]on structs and enums: unknown keys fail withunrecognized_field(the tag /contentkeys of tagged enums are allowed), and the JSON Schema getsadditionalProperties: false. On a unit variant of an internally tagged enum vld rejects extra keys, which serde lets through.VldSchema::try_transform(|v| -> Result<U, E>): a fallible transform whoseErr(E: Display) becomes a validation issue (Custom { code: "transform" }).
0.6.0 - 2026-11-07
Breaking changes
- Regex:
regex-liteis no longer public.string().regex(Regex)/regex_msgand thevld::regex_litere-export are removed; usestring().pattern("...")/pattern_msg, orvld::rules::Pattern::new(..)to handle an invalid pattern. Both need theregexfeature, asregex()did. - optional / nullable / nullish now differ:
nullable()object fields are required (absent →missing_field,null→None) and listed in JSON Schemarequired;optional()no longer addsnullto its JSON Schema (parsing still acceptsnull, which serde writes forNone). TypeScript output follows:x?: T,x: T | null,x?: T | null. - Unions:
Either/Either3serialize untagged, so a union inside an object round-trips as the bare value instead of{"Left": ...}; unions forwardoutput_jsonto the matching variant. - Removed everything deprecated in 0.5: the
serialize/deserializefeatures,ZFloat::finite,ZObject::field_schema/deep_partial,vld-actix::VldJsonError,vld-diesel/vld-sqlx::validate_update,vld-surrealdb::validate_record,vld-http-common::{ValidationIssueWithCode, format_issues_with_code, format_json_parse_error, format_utf8_error},vld-tower/vld-rama::try_validated,vld-tauri::{validate_event, validate_state, validate_plugin_config, validate_channel_message},impl_to_lapin!,impl_to_redis!,impl_to_redis_async!,vld-utoipa::{impl_into_params!, impl_to_schema_query!, impl_to_schema_path!}. DynSchemahas a new required methoddyn_parse_missing(implemented for everyVldSchema; only hand-written impls need it).
Migration from 0.5
See the migration guide.
Added
- Custom rules (
vld::rules): theRule<T>trait (key, check, optional message and JSON Schema keywords),rules::from_fn,ZString::rule/rule_msg(keeps the string builder) andVldSchema::rule/rule_msgon any schema. A failing rule reportsCustom { code: <key> }, so it can be translated by key. #[derive(Validate)]on enums, following serde: externally tagged,tag,tag+content,untagged; unit, newtype, tuple and struct variants; variantrename/alias/skip/other/rename_alland enumrename_all/rename_all_fields. The output is the enum itself; the JSON Schema isoneOfwith an OpenAPIdiscriminator(anyOfwhen untagged).#[derive(Validate)]supports#[serde(flatten)]on fields: parsed from the same object, JSON Schema properties merged.VldSchema::parse_missing: what an absent object key parses to (wrappers forward it).vld::Schema:VldSchemaplus the JSON Schema traits underopenapi, forfn f() -> impl vld::Schema<Output = T>.ValidationIssue::path_string()(.lab.fund[0].vigor).- Inherent
vld_parse_valueon#[derive(Validate)]/schema!types (noVldParseimport needed). Either::into_innerwhen both sides have the same type.
Fixed
vld-schemars:patternandpatternPropertiesregexes are compiled once and cached instead of on every validated value.
0.5.1 - 2026-11-06
Changed
- All crates use Rust edition 2024 (MSRV unchanged: 1.85).
- Dependencies used only by tests are no longer normal dependencies (
serde/serde_jsonin several integration crates); unused ones are removed (hyper,http-body-utilinvld-axum,serdeinvld-config,tokioinvld-tonic,hyper/hyper-utilinvld-tower). vld-fake: password generation no longer usesunsafe; every crate forbidsunsafe_code.- Every public item has rustdoc documentation (
missing_docsis on in every library crate).
0.5.0 - 2026-11-06
Breaking changes
- Features: the
stdfeature is gone (everything it gated is always available);serialize/deserializeare deprecated no-ops (removed in 0.6);diffenablesopenapi. - Date backends are additive:
ZDate/ZDateTimeare generic over the backend and each feature has its own module (vld::chrono,vld::jiff,vld::time).vld::date()/vld::datetime()and the prelude aliases exist only when exactly one backend is enabled. Previously the backend was picked silently (chrono > jiff > time). - Issue codes:
IssueCodehas a typed variant for every built-in check (InvalidLength,InvalidFormat,InvalidDate,NotMultipleOf,InvalidEnumValue,InvalidUnion,NotUnique,MissingField,FileTypeNotAllowed,SerializeError, …);Customis for user codes only.TooSmall/TooBigcarryorigin: SizeOriginand aserde_json::Valuebound instead of anf64.IssueCode,StringValidationandDateKindare#[non_exhaustive]. - Messages: default messages come from one English template table; an absent required key reports
missing_field(a presentnullstaysinvalid_type);Displayno longer appends ", received X" toinvalid_type. - Module layout: core split into
schema/,error/,object/,macros/,openapi/(old pathsvld::json_schema,vld::diff,vld::format,vld::i18n,vld::inputremain as aliases); the inherentto_json_schema()duplicates are gone (use theJsonSchematrait). - JSON Schema: optional / nullable / nullish fields and unions emit
anyOf(wasoneOf);ZNullable::is_required()isfalse. - Caching:
schema!,impl_validate_fields!,impl_rules!and#[derive(Validate)]build field schemas once per process, so field schemas must beSend + Sync + 'static;VldInput::to_json_valuereturnsCow<Value>. #[derive(Validate)]:validate_fields()/parse_lenient()are generated only with#[vld(lenient)];#[serde(flatten)]/aliasare compile errors.- Web adapters: every
VldJsonextractor answers 415 unless the content type isapplication/jsonorapplication/*+json; malformed JSON is 422 with the validation body (was 400); 422 issues carry acodefield; query/path/form/header/cookie values fall back to the original text when the schema wants a string (parse_coerced). vld-tower/vld-rama:validated()returnsOption<T>; the tower inner service receivesRequest<ValidatedBody<B>>(non-JSON bodies are no longer buffered).vld-warp:handle_rejectionmaps warp rejections to their real status (unknown → 500 instead of 404); bodies are read as a stream with a limit (413).vld-ntex: ntex 4 is the default (ntex-4);default-features = false, features = ["ntex-3"]keeps ntex 3. Crate MSRV 1.97.vld-ts:with_defaultemitsx.nullish().transform((v) => v ?? d)(Zod) /v.nullish(x, d)(Valibot), matching vld, which acceptsnullthere.vld-clap:validate_or_exitrequiresclap::CommandFactoryand reports clap's real argument names; depends on clap 4.- Issue paths in
vld-tauri,vld-leptos,vld-dioxus,vld-surrealdbhave no leading dot (user.email,items[0]).
Migration from 0.4
- Cargo features: drop
std,serialize,deserializefrom your feature lists. - Dates: with one backend nothing changes. With several, call
vld::chrono::date(),vld::jiff::datetime(),vld::time::time()and namevld::chrono::ZDateetc. - Matching on issue codes: replace
IssueCode::Custom { code: "…" }checks for built-in errors with the typed variants;TooSmall { minimum, .. }now hasoriginand a JSONminimum(minimum.as_f64()). Add a_ =>arm (non-exhaustive enums). PreferIssueCode::key()for stable string codes. - Messages / i18n: tests that compared full English messages may need updating (
missing_field, no ", received X"); custom translation tables can add the new keys (missing_field,type.<name>,too_small.<origin>, …), the specific key is tried before the generic one. - JSON Schema consumers: expect
anyOfinstead ofoneOffor optional / nullable fields and unions. - Web clients: send
Content-Type: application/json; handle 415 and 422 (malformed JSON), read the newcodefield. - Derive: add
#[vld(lenient)]where you callvalidate_fields()/parse_lenient(). - ntex 3 users:
vld-ntex = { version = "0.5", default-features = false, features = ["ntex-3"] }. - vld-ts: regenerate client schemas; defaults now accept
null. - vld-clap: derive
clap::Parser(or implementCommandFactory) forvalidate_or_exit, or callvalidate_cli. - tower / rama:
validated()returnsOption;try_validatedis deprecated. - MSRV: see MSRV.md.
Added
- Schemas: sized integers
vld::i8()…u64(),isize(),usize(),vld::f32();vld::null(),vld::never(),vld::char();vld::from_serde(),vld::from_str(),vld::enum_of(); time-of-dayvld::{chrono,jiff,time}::time()/vld::time_of_day();vld::record_with_keys()andZRecord::ordered(); tuples up to arity 12; string formatsbase64url()andjson();ZInt::coerce();ZDecimalgt/lt/multiple_of. parse_coerced: schema-aware fallback for values coerced from text.duration()accepts fractional seconds (1.5,"1.5s","PT1.5S").ZFile::within(base); accessors onZLiteral,ZMap,ZPipe,ZDiscriminatedUnion,ZLazy;type_error()onZBoolean/ZEnum/ZJsonValue.- Complete Russian, German and Spanish message tables; translated type names.
vld-integration-common(new crate): shared DB column wrappers, errors and form helpers for the integration crates.vld-http-common:VldHttpError, shared JSON / form / header / cookie helpers,require_json_content_type, aconformancetest suite (test-only feature).vld-redis: asyncAsyncRedisConn(aiofeature); the selected redis crate is re-exported.vld-ntex: ntex 4 support.vld-rocket:vld_413_catcher,vld_415_catcher,vld_catchers().vld-diesel:VldFloat,VldBool; wrappers usable inInsertable/.filter().vld-sea:with-json,with-chrono,with-uuid,with-rust_decimal,with-bigdecimalfeatures.vld-clap:validate_cli.vld-ts: named exports (to_zod_export,to_valibot_export).vld-schemars: OpenAPI 3.0 output underSchemaSettings::openapi3().
Changed
- Faster parsing:
serde_json::Valueinput is borrowed, cached field schemas (regexes compiled once), default messages rendered without allocations per key. vld-aidereusesvld-schemarsinstead of duplicating the bridge.vld-fakegenerates values that satisfy far more schemas (patterns, all core formats,$ref,multipleOf, property counts) and seeds its randomness.imageis built without its defaultavifencoder (only image headers are read).- Packages ship only
src/, README, LICENSE (and the changelog forvld).
Fixed
- Strings: char-safe ISO date/time parsing (calendar-checked), strict IPv4/IPv6/CIDR via std,
url_strictblocks loopback / private / link-local hosts, stricter email / phone / credit-card / emoji / cuid2,base64url()rejects+and/. - Numbers: exact
ZInt(no f64 round-trip), NaN never passes a bound, tolerantmultiple_of, the strictest bound is reported,f32::MAXaccepted. - Collections / combinators: an inner error without issues no longer turns into success; union errors keep per-variant issues; maps reject duplicate keys; unique compares numbers by value; no panics in intersection / tuple /
schema!/ derive. - Dates: one strict format for all backends;
timedatetime defaults rendered as RFC 3339. ZPath::within/ZFile::within: lexical containment with symlink resolution of existing ancestors; file reads are bounded.- JSON Schema / OpenAPI: resolvable
$refs and nested components forschema!and derive,requiredomits optional fields, literals emitconst, mapsprefixItems, recordspropertyNames/ min/maxProperties;diffsees changes inside optional fields and composites. - Derive: generics, raw identifiers, serde
rename_all/rename(deserialize)/skip/default;synerrors instead of panics. - Web adapters: body limits → 413 everywhere (ntex overflow detection, salvo forms, rocket mount paths and form limits, warp chunked bodies, rama limit errors), actix
{id:\d+}path patterns, percent-decoded path params and cookies, lossless query coercion, repeated keys as arrays. vld-lapin:nack_decode/reject_decodesettle invalid messages instead of valid ones.vld-sea: chrono / uuid / json / decimal / bytes columns no longer validate asnull.vld-sqlx:VldIntdecodes INT4 / INT2 columns.vld-utoipa: annotations kept on refs / composites / arrays,anyOfand type arrays supported, exact u64 bounds, tupleprefixItems.vld-schemars:$refs point at the generator's definitions path; the validator handles$ref,additionalProperties,prefixItems.vld-ts: valid JS output (escaped literals, quoted keys,new RegExp), descriptions and defaults kept.vld-tonic,vld-tauri,vld-clap,vld-surrealdb,vld-leptos,vld-dioxus: clean issue paths.vld-config:VldConfigError::source(); env example usestry_parsing.
Security
- All 0.4.7 security fixes (see below).
vld-tower:Application/JSONand+jsonbodies no longer bypass validation; JSON bodies are size-limited.- Dependencies refreshed: 21 of 23 RustSec advisories cleared (two remaining, documented in
deny.toml).
Removed
- The
stdfeature. - Inherent
to_json_schema_inner()/ per-typeto_json_schema()duplicates (theJsonSchematrait remains;ZObject::to_json_schemastays). vld-http-common::extract_path_param_names(unused).
0.4.7 - 2026-11-06
Fixed
- Security
vld-poem:VldPathread the query string instead of the matched route parameters, so/users/42failed validation and/users/42?id=7validatedid = 7(client-controlled). It now usesRequest::path_params. - Security
vld: a string longer than 100 bytes whose 97th byte falls inside a multi-byte character (e.g. Cyrillic, accented Latin) panicked while being stored asreceivedin an error — any request body could crash the process. Truncation is now char-based. - Security
vld:string().iso_date()/iso_time()/iso_datetime()panicked on non-ASCII input ("123é56789") and on"2024-01-01T". - Security
vld(timebackend):datetime()panicked when the UTC instant left the supported year range ("9999-12-31T23:00:00-05:00"); it is now a validation error. Requirestime >= 0.3.47. - Security
vld:string().url_strict()never checked IPv6 hosts (http://[::1]/,http://[fd00::1]/,http://[::ffff:127.0.0.1]/passed) and allowed0.0.0.0,localhost.and*.localhost. - Security
vld:path().within(base)acceptedbase/../outsidewhen the target did not exist (lexical..was not resolved). - Security
vld-http-common: with duplicate cookie names the last value won, allowing cookie tossing; the first occurrence now wins.
0.4.6 - 2026-11-05
Fixed
- JSON Schema / OpenAPI:
.with_default(value)now emits"default": value(#8). TheJsonSchemaimpl forZDefaultrequires the output type to beserde::Serialize chrono,jiff,time(human-readable) andipnetoptional deps now enable theirserdefeatures so date/network outputs keep working withwith_defaultin schemas
0.4.5 - 2026-10-01
Fixed
- HTTP adapters: enforce body size limits (axum
Bytes/DefaultBodyLimit, warpcontent_length_limit, poeminto_bytes_limit, ramaBody::limited) and return 413 on overflow vld-warphandle_rejection: mapLengthRequired→ 411 andPayloadTooLarge→ 413 (no longer collapse to 404)- actix/ntex/salvo: remapped payload overflow to 413 instead of always 422
- poem: malformed JSON uses
format_vld_error(422); ramaValidateJsonLayeraligned to 422 + validation body vld-http-common: consistent issue path formatting (.user.age) forformat_issues/format_issues_with_code
0.4.4 - 2026-10-01
Changed
- Bump optional core pins:
infer0.22,rust_decimal1.43,ipnet2.12.2,phonenumber0.3.10 vld-salvo: Salvo 1.x only (salvo = "1"); crate MSRV 1.94 (cross-major>=0.89,<2dual-loadssalvo_core/ breaksExtractible)vld-sea: dual featuressea-orm-1(default) /sea-orm-2;Value::Enum→ JSON string on 2.x; entity-macro integration tests stay on 1.x;sea-orm-2requires Rust 1.94+vld-utoipa: dual featuresutoipa-5(default) /utoipa-6(CI tests both);utoipa-6requires Rust 1.88+
Deferred
syn3, ntex 4 (beta), aide 0.16 (alpha) — wait for stable / lower churn
0.4.3 - 2026-10-01
Fixed
- Omit
.optional()/.nullish()/.with_default()fields from JSON Schemarequired(and keep.nullable()required) acrossschema!,#[derive(Validate)], andZObject(#6) - Forward
JsonSchema::is_requiredthrough describe/refine/message/transform/catch wrappers vld-utoipa::json_schema_to_paramsuses the objectrequiredarray (so.nullable()query/path params stay required; oneOf+null no longer forcesRequired::False)
0.4.2 - 2026-09-27
Added
- Add vld-rama for Rama HTTP validation
Fixed
- Bring VldSchema into schema! OpenAPI helpers
- Drop unused VldSchema imports after schema! fix
0.4.1 - 2026-09-26
Fixed
- Register transitive nested OpenAPI schemas
- Alias NestedSchemaCollectFn for clippy type_complexity
0.4.0 - 2026-07-02
Changed
- Refresh crate links and dependency versions
- Enhance build and test process for vld-diesel
Fixed
- Make path-within check deterministic in CI
- Restore integration examples and tests build
0.3.0 - 2026-03-20
Added
- Add native vld transport integrations
- Add bytes schema and stricter datetime validation
- Add timezone-aware datetime and file schema validation
- Extend file storage access and refresh formatting
- Add advanced typed schemas and cross-crate format support
Changed
- Simplify Zod/Valibot generation API
- Remove unused full-file generation internals
- Gate heavy validators behind opt-in features
Fixed
- Run per-crate preflight safely
- Satisfy strict clippy assertions
- Replace approximate float constant in test
- Keep float coercion expectation exact
- Remove unused prelude imports
- Remove unused prelude imports
- Remove unused VldSchema import in tests
- Align prelude trait imports for optional combinators
- Stabilize clippy around optional combinator trait imports
0.2.0 - 2026-03-19
Added
- Add tonic gRPC integration for vld validation
- Add Leptos integration for shared server/WASM validation
- Add SQLx integration for vld validation
- Add Dioxus integration for shared server/WASM validation
- Add ntex web framework integration
- Add aide/schemars integration for OpenAPI generation
- Add SurrealDB integration for JSON document validation
- Add bidirectional bridge between vld and schemars
- Add reverse direction — schemars → vld validation
- Add nested schema auto-registration for OpenAPI
- Auto-register nested schemas in utoipa components
- Auto-register nested schemas in schemars definitions
Changed
- Replace standalone functions with macro+trait API
- Add nested schema auto-registration section to README
- Add dead code allowance for unused schema methods
Fixed
- Formatting, clippy warnings, and missing imports across workspace
0.1.3 - 2026-03-19
Added
- Add health check endpoint and response schemas
- Generate json_schema() for derive(Validate), enabling utoipa integration