NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #3843 most downloaded on pub.dev
Schema validation and bidirectional codecs for Dart and Flutter
Latest stable
1.7.1
Last release 16 days ago
06 Nov 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 16 of 17 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
47 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
Breaking: Is…/Has… rule annotations replace the Validate namespace. Validate remains as deprecated redirects and is removed before Ack 2.0.0.
>=3.13.0 and Flutter >=3.47.0.Is…/Has… rule annotations replace the Validate namespace.
Validate remains as deprecated redirects and is removed before Ack 2.0.0.ack and ack_generator at 2.0.0-beta.3.
Upgrade the five packages together.>=3.13.0 (Flutter >=3.47.0, which bundles
Dart 3.13.0). Dart 3.13 adds the primary constructors that the class-first
examples use. Apps on Flutter 3.41 to 3.46 cannot use Ack 2.0.Is… says what a value is and Has… says
a bound or property it has. @IsOptional, @IsRequired, @IsNotNull,
@HasMin, @HasMax, @IsMultipleOf, @IsPositive, @IsNegative,
@HasMinLength, @HasMaxLength, @HasMatch, @IsNotEmpty, @IsEmail,
@IsUrl, @IsUri, @IsUuid, @IsDate, @IsDateTime, @IsIp,
@HasMinItems, @HasMaxItems, and @HasUniqueItems keep the semantics of
the matching Validate constructors. ipv4() and ipv6() become
@IsIp(version: 4) and @IsIp(version: 6).Validate, including the class. Each constructor redirects to
its rule annotation and names that replacement. kind and value stay
visible on those rules until Validate is removed before Ack 2.0.0.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Breaking: Object defaults fill omitted keys; explicit JSON null requires a nullable property. Missing or null defaulted fields encode as the default.
@Validate.*, regenerate model parts, and upgrade all five packages together.toString() output.null is rejected unless the property accepts null; use
.nullable().withDefault(value) to parse a present null as the default.
Direct parsing with a defaulted schema still resolves parse(null).ConstraintError, DurationConstraint, AckException, Ok,
and Fail are now final, so code outside Ack can no longer implement or
extend them.Restrict Ack.preserveBoundary to JSON-object schemas (AckSchema ), such as objects, maps, discriminated unions, and lazy, default, or codec wrappers o
Ack.preserveBoundary to JSON-object schemas
(AckSchema<JsonMap, R>), such as objects, maps, discriminated unions, and
lazy, default, or codec wrappers over them. BoundarySchema no longer takes
a type argument. Compose list wire views as Ack.list(X.wireSchema), and use
a codec's input schema, such as Ack.string().datetime(), for a scalar.BoundarySchema parse, runtime validation, and encode instead of the
caller's map instance.deepUnmodifiableCopy helper for generated immutable
constructors. It snapshots nested collections without validating data or
changing opaque noncollection objects.Duration
representation instead of silently decoding to a different duration.BoundarySchema for every string-keyed map
container, including jsonDecode output, without running an encoder. Nested
codec values keep their wire form, one-way transforms no longer reject valid
input, and wrapped defaults are not injected.BoundarySchema values with parse semantics during encode and
runtime validation, so encode no longer accepts a value that parse rejects.Ack.preserveBoundary
unchanged instead of validating its values twice.allOf: [{not: {type: null}}]
only when the narrowed schema can still accept null.First prerelease of Ack 2.0, published for ack, ack_generator, ack_json_schema_builder, ack_firebase_ai and ack_mcp_dart. It runs on stable Dart (3.13
First prerelease of Ack 2.0, published for ack, ack_generator, ack_json_schema_builder, ack_firebase_ai and ack_mcp_dart. It runs on stable Dart (3.13 language features, including primary constructors on @Schemable classes).
Breaking
@AckType, @AckInfer, @AckModel, @AckField and friends). Use @Schemable() on top-level schemas and on hand-written classes and unions.@Optional, @Min, @Matches, @Email, …) and package:ack/format_annotations.dart with the @Validate.* namespace.Ack.enumCodec (use Ack.enumValues) and the unused StandardSchemaV1; seal SchemaError and AckSchema.Ack.fromJsonSchema() defaults to assertFormats: false, matching Draft 2020-12; toJsonSchema() preserves imported Draft 2020-12 resources (use toJsonSchemaDraft7() for Draft-07 lowering).Added
@Validate.* presence and constraint annotations, exported from package:ack/ack.dart and package:ack/annotations.dart.JsonMaybe<T> for PATCH-style tri-state presence.@Schemable(schemas: [...]) and @AckKey('...') for custom schema registration and wire-name overrides..trim(), .toLowerCase(), .toUpperCase()) on StringSchema.Ack.fromJsonSchema()..g.dart part per library and applies scalar @Validate.* constraints to List/Set items.Full notes are in each package's CHANGELOG.md under 2.0.0-alpha.1.
@AckType, @AckInfer, @AckModel,
@AckField, JsonKeyCaseStyle, AckFieldPresence, and
@Schemable.generatedJson). Use @Schemable() on both top-level schemas and
hand-written classes/unions (#188, #189).@Optional, @Required, @NotNull),
the 18 @Deprecated 1.x top-level constraint classes (@Min, @Max,
@MultipleOf, @Positive, @Negative, @MinLength, @MaxLength,
@Matches, @NotEmpty, @Email, @Url, @Uuid, @Date, @DateTime,
@Uri, @Ip, @Ipv4, @Ipv6, @MinItems, @MaxItems, @UniqueItems), and
package:ack/format_annotations.dart in favor of @Validate.* (#191).Ack.enumCodec in favor of Ack.enumValues and remove unused
StandardSchemaV1 (#129).SchemaError and AckSchema so pattern matching across all error and
schema subtypes is exhaustive without a wildcard branch.Errors (TypeError, StateError, etc.) with their
original stack trace during CodecSchema decode (parse / safeParse),
matching encode / safeEncode (#163).Ack.fromJsonSchema() now defaults to assertFormats: false to match JSON
Schema Draft 2020-12's default Core/Applicator/Validation vocabularies; pass
assertFormats: true (or declare the format-assertion vocabulary in
$vocabulary) to enforce format assertions (#171, #186).schema.toJsonSchema() and schema.toSchemaModel() now preserve imported
Draft 2020-12 resources by default ($defs, $dynamicRef,
unevaluatedProperties, prefixItems, etc.). Use toJsonSchemaDraft7() or
toSchemaModelDraft7() for legacy Draft-07 definitions lowering (#171).@Validate.* presence and constraint annotation namespace
(final class Validate, including @Validate.optional(),
@Validate.required(), and @Validate.notNull()) exported from both
package:ack/ack.dart and package:ack/annotations.dart (#191).sealed class JsonMaybe<T> (JsonAbsent<T>, JsonValue<T>) with
JsonMaybe.absent(), JsonMaybe.value(T? value), and JsonMaybe.nullValue()
for PATCH tri-state presence (#148).@Schemable(schemas: [...]) (supported on classes, sealed unions, and
library; directives) and @AckKey('...') for custom schema registration and
field wire-name overrides (#185, #189)..trim(), .toLowerCase(), and .toUpperCase() two-way normalizers
directly on StringSchema that execute in declaration order alongside
constraints during both parse and encode, preserve StringSchema
chaining, and export as type: 'string' without 'x-transformed': true.Ack.fromJsonSchema(), including $dynamicRef, $dynamicAnchor,
unevaluatedProperties, unevaluatedItems, prefixItems,
dependentRequired, dependentSchemas, patternProperties, minContains,
maxContains, bundled offline 2020-12 meta-schemas, and the full Draft
2020-12 format suite (#171, #186).toJsonSchemaDraft7() / toSchemaModelDraft7())
rejects unsupported Draft 2020-12 assertions rather than emitting keywords
that Draft-7 validators ignore.allOf when layering
conflicting constraints), and reject conflicting resource definitions.Keep the generator's JSON dependencies compatible with the supported Dart 3.9 SDK, including clean builds in consumer packages: ack_generator bounds s
ack_generator bounds source_helper below 1.4 so json_serializable 6.14 compiles on Dart 3.9 through 3.11. Newer SDKs can still select json_serializable 6.15 (#248).Add @Schemable() as the unified annotation for schema-first and class-first generation; deprecate @AckInfer() and @AckModel() for removal in 2.0.0.
ack_annotations; annotations now ship in ack (package:ack/ack.dart, package:ack/annotations.dart, and package:ack/format_annotations.dart).@Schemable() as the unified annotation for schema-first and class-first generation; deprecate @AckInfer() and @AckModel() for removal in 2.0.0.@Pattern to @Matches (keeping a deprecated Pattern alias in package:ack/annotations.dart) and remove the json_annotation re-export from ack.schema (including extension types, enums, and generic schema<A>() factories), and generate a static final schema shorthand on schema-first models.$ClassCopyWith<Class> getter for copyWith on generated models, support explicit description options and @description doc tags (#175), require unique boundary items on constrained Set fields, and escape control characters in generated string literals (#164).Ack.fromJsonSchema() with multipleOf (exact decimal division), contains, if/then/else, built-in string and numeric format assertions, x-* vendor extensions, Draft-07 $schema URIs, and JsonSchemaValidationError location diagnostics (keyword, keywordLocation, documentUri, pointer).pattern expressions now compile in ECMA-262 Unicode mode (u); native Ack.string().matches() is unchanged.safeParse, safeEncode, toJsonSchema(), imported JSON Schema validation, and collection parse/encode results.ack_generator requires ack: ^1.7.0; adapter dependency minimums are unchanged).ack_annotations; annotations now ship in ack:
package:ack/ack.dart exports @Schemable() and core model annotations
(AckField, Optional, Required, NotNull, AckCaseStyle,
AckUnknownPropertyPolicy).package:ack/annotations.dart exports model and constraint annotations
(plus deprecated aliases).package:ack/format_annotations.dart exports string format annotations.@Pattern to @Matches (Pattern remains a deprecated alias in
package:ack/annotations.dart).json_annotation dependency and JsonKey re-export from ack.pattern expressions in ECMA-262 Unicode mode
(u). Invalid Unicode-mode patterns (such as \- outside a character class)
now fail import with invalid_schema. Native Ack.string().matches() retains
Dart regex semantics.@Schemable() as the unified annotation for schema-first and class-first
code generation, AckModelAdapter.modelSchema, and CodecSchema.canEncode.Ack.fromJsonSchema() with:
contains, if/then/else, and multipleOf (sharing exact decimal
division with native .multipleOf()).date-time, date, email, uuid, uri,
ipv4, ipv6) and numeric formats (int32, int64, uint32, uint64,
float, double).x-* vendor extension annotations (including x-transformed) and Draft-07
$schema URIs.JsonSchemaValidationError (keyword, keywordLocation, documentUri,
pointer) for imported JSON Schema validation failures.safeParse, safeEncode, toJsonSchema(), imported JSON Schema
compilation/validation, and Ack.object() / Ack.list() / Ack.map()
unmodifiable result views.t and z on announced leap seconds in RFC 3339 date-time
validation.uniqueItems failures.@AckInfer() and @AckModel() in favor of @Schemable().No new breaking changes or generator migrations are introduced in 1.7.0-beta.7. When upgrading from 1.6.2 or earlier 1.7.0 betas:
All five packages are aligned at 1.7.0-beta.7: ack, ack_generator, ack_json_schema_builder, ack_mcp_dart, and ack_firebase_ai.
multipleOf in imported JSON Schemas (#214): Ack.fromJsonSchema() now validates multipleOf for number and integer schemas using exact decimal division (shared with native .multipleOf()) and reports keywordLocation on failures.format assertions and x-* extensions in imported JSON Schemas (#216): Ack.fromJsonSchema() now validates built-in string formats (date, email, uuid, uri, ipv4, and ipv6, in addition to date-time), standard numeric formats (int32, int64, uint32, uint64, float, and double), and accepts x-* vendor extension annotations (such as x-transformed).$schema URI support (#217): Ack.fromJsonSchema() now accepts http(s)://json-schema.org/draft-07/schema (with or without a trailing #), allowing schemas exported by .toJsonSchema() to be re-imported directly.Ack.fromJsonSchema() reads typed node fields directly instead of per-node keyword maps, toJsonSchema() skips redundant subtree walks when constraints do not project nested keywords, and Ack.object(), Ack.list(), and Ack.map() return detached unmodifiable views without a second collection copy.No new breaking changes or generator migrations are introduced in 1.7.0-beta.7. When upgrading from 1.6.2 or earlier 1.7.0 betas:
1.7.0-beta.4 or earlier: Imported pattern expressions compile in ECMA-262 Unicode mode (u flag); see the 1.7.0-beta.5 release notes.1.7.0-beta.2 or earlier: Annotations ship in package:ack with @Schemable() as the unified entry point; see the 1.7.0-beta.3 changelog.Ack.fromJsonSchema() now supports multipleOf for number and integer
schemas. Non-positive or non-numeric multipleOf values fail import with an
invalid_schema diagnostic.Ack.fromJsonSchema() now validates built-in string formats (date,
email, uuid, uri, ipv4, and ipv6, in addition to date-time),
standard numeric formats (int32, int64, uint32, uint64, float, and
double), and accepts x-* vendor extension annotations (such as
x-transformed). Unknown format labels and non-x-* extension keywords
continue to fail import with unsupported_keyword.Ack.fromJsonSchema() now accepts Draft-07 $schema URIs
(http(s)://json-schema.org/draft-07/schema with or without a trailing #),
so schemas exported by .toJsonSchema() can be re-imported without stripping
$schema..multipleOf() and imported multipleOf now share exact decimal
division on the number's decimal digits, avoiding binary floating-point
remainder drift (such as 0.3 with 0.1) and overflow on large finite
doubles.toJsonSchema() on native schemas by skipping redundant subtree
walks when constraints do not project nested keywords.Ack.object(), Ack.list(), and
Ack.map() parse and encode results instead of copying the validated
collection a second time. Results remain detached from the input and
unmodifiable.No new breaking changes or generator migrations are introduced in 1.7.0-beta.6. When upgrading from 1.6.2 or earlier 1.7.0 betas:
All five packages are aligned at 1.7.0-beta.6: ack, ack_generator, ack_json_schema_builder, ack_mcp_dart, and ack_firebase_ai.
JsonSchemaValidationError now includes keywordLocation (and serializes it in toMap()), reporting the evaluation path from the root schema to the failing keyword across each $ref traversal.uniqueItems error path (#207): Imported uniqueItems validation failures now report the array path (for example #) instead of the duplicate element index, matching native Ack.list(...).unique().safeParse and safeEncode cache default root context names per schema type, and Ack.fromJsonSchema() reuses compiled pattern regular expressions and validates copied JSON inputs in fewer passes. Error output is unchanged.No new breaking changes or generator migrations are introduced in 1.7.0-beta.6. When upgrading from 1.6.2 or earlier 1.7.0 betas:
1.7.0-beta.4 or earlier: Imported pattern expressions compile in ECMA-262 Unicode mode (u flag); see the 1.7.0-beta.5 release notes.1.7.0-beta.2 or earlier: Annotations ship in package:ack with @Schemable() as the unified entry point; see the 1.7.0-beta.3 changelog.JsonSchemaValidationError now reports keywordLocation, the Draft 2020-12
evaluation path from the root schema to the failing keyword. It includes each
$ref on the way, so failures under two applicators that share a definition
are distinguishable. toMap() includes it.safeParse and safeEncode no longer rebuild the root error-context name on
every call. Ack computes it once per schema type, and skips it when the
caller passes debugName. A valid Ack.string() parse takes about 50 ns
instead of 360 ns on an AOT build.pattern regular expressions
compiled at import and allocates less per schema node. Error output does not
change.uniqueItems failure now reports the array as its
path, for example # instead of the later duplicate at #/2. Native
Ack.list(...).unique() and the JSON Schema output format use the same
location. keyword and pointer do not change.Imported `pattern` expressions now use ECMA-262 Unicode mode. This is a deliberately accepted breaking change in 1.7.0, affecting users upgrading from…
contains and if/then/else.keyword, documentUri, and pointer through JsonSchemaValidationError. Source pointers correctly encode URI fragments containing percent signs, spaces, #, and Unicode.Imported pattern expressions now use ECMA-262 Unicode mode. This is a deliberately accepted breaking change in 1.7.0, affecting users upgrading from stable 1.6.2 or earlier 1.7.0 betas.
. matches one code point: ^.$ accepts 😀, while ^..$ no longer matches its two UTF-16 code units. Review identity escapes too; replace ^\d{3}\-\d{4}$ with ^\d{3}-\d{4}$ outside character classes. Invalid Unicode-mode patterns fail import with an invalid_schema diagnostic.
Native Ack.string().matches() retains its Dart regex behavior. A native pattern can behave differently or fail import after export to JSON Schema.
Existing SchemaValidationError catches still work. Consumers requiring an exact runtime type or serialized error-map shape should allow the new subtype and its three additional fields. Initial null-input and JSON-value checks retain their existing Ack error types.
The beta.3 annotation and generator migrations still apply to users upgrading from older versions.
Full workspace tests, minimum Dart/Flutter checks, API comparison against 1.6.2, deterministic generation, Draft-7 validation, documentation validation, and zero-warning publish dry runs passed. The local aggregate passed 2,161 tests, including 394 generator tests; four opt-in Firebase live tests were skipped without credentials.
pattern in ECMA-262 Unicode mode (the
u flag), as the JSON Schema Test Suite requires. . matches one code point
and \p{...} is a Unicode property escape. Patterns that are invalid in
Unicode mode now fail import with an invalid_schema diagnostic. For
example, write - instead of \- outside a character class.
Ack.string().matches() retains native Dart regex behavior; a native pattern
can behave differently or fail import after export to JSON Schema. Review
imported patterns when upgrading from stable 1.6.2 or earlier 1.7.0 betas,
including expressions that count UTF-16 code units or use identity escapes.contains and if/then/else.
minContains and maxContains remain unsupported, because Draft-7 export
cannot represent them.JsonSchemaValidationError. Its keyword, documentUri, and pointer
identify the failing keyword in the source schema after $ref resolution.
Existing SchemaValidationError catches still work; consumers that require
an exact runtime type or serialized map shape should allow the subtype and
its three additional fields. Initial null-input and JSON-value checks retain
their existing Ack error types.#, or Unicode.All five packages are aligned at 1.7.0-beta.4: ack, ack_generator, ack_json_schema_builder, ack_mcp_dart, and ack_firebase_ai.
All five packages are aligned at 1.7.0-beta.4: ack, ack_generator, ack_json_schema_builder, ack_mcp_dart, and ack_firebase_ai.
Ack.fromJsonSchema() now validates the supported date-time format automatically. Unsupported format labels continue to produce diagnostics.Ack.string().datetime() now accepts lowercase t and z on announced leap seconds.ack 1.7.0-beta.4 or later, without a new API or dependency minimum.final timestamp = Ack.fromJsonSchema({
'type': 'string',
'format': 'date-time',
});
timestamp.parse('2024-02-29T12:34:56.123456789+02:00');
Ack's strict JSON Schema importer supports a documented subset; this release does not claim full JSON Schema Draft 2020-12 support.
No new generator or annotation migration is introduced in beta.4. When upgrading from beta.2 or earlier, the beta.3 breaking migrations still apply: annotations moved into ack, @Schemable() is the unified entry point, and JsonKey is no longer re-exported. See the repository changelog for the full migration details.
The reviewed release commit passed CI, browser tests, release preflight, schema validation, API compatibility checks, and zero-warning publish dry runs for all five packages.
Release commit: 0023d152288fb69b2967d230481fe8b681606d8b.
date-time format.
Other format labels remain unsupported and are reported at their schema
location. Parsing preserves the original timestamp string, including
announced leap seconds.t and z on announced leap
seconds, as it already did on ordinary RFC 3339 timestamps.Files that use constraint annotations or the deprecated spellings also import package:ack/annotations.dart, with a prefix (as ack) where a name clashe…
ack_annotations package; the annotations ship in ack. Models
import package:ack/ack.dart (@Schemable, @AckField, @Optional,
@Required, @NotNull). Files that use constraint annotations or the
deprecated spellings also import package:ack/annotations.dart, with a
prefix (as ack) where a name clashes with another type. Format
annotations move to package:ack/format_annotations.dart.@Schemable() is the single annotation for schema-first and class-first
generation. @AckInfer() and @AckModel() are deprecated and will be
removed in 2.0.0.@Pattern to @Matches. The deprecated Pattern alias stays in
package:ack/annotations.dart; an unprefixed import of that library hides
dart:core's Pattern.ack no longer depends on json_annotation or re-exports JsonKey. A field
renamed with @JsonKey(name: ...) imports JsonKey from
package:json_annotation and the app depends on json_annotation.
AckModel.jsonSerializable and AckGeneratedJson.config are removed.schema resolves to it with
no annotation, including extension types, enums, and generic types through a
static schema<A>() method that can receive each type argument's schema.@AckField(schema:) functions, non-finite constraint values, @Schemable
options for the other target, and JsonConverter annotations on class-first
models.ack 1.7.0-beta.3.ack_annotations package is removed and its annotations ship in ack.
Remove ack_annotations from pubspec.yaml. package:ack/ack.dart
exports @Schemable() and the model annotations (AckField, Optional,
Required, NotNull, AckCaseStyle, AckUnknownPropertyPolicy, and the
deprecated AckFieldPresence). Replace
package:ack_annotations/ack_annotations.dart with
package:ack/annotations.dart, which exports the model annotations, the
constraints and the deprecated spellings, and
package:ack_annotations/format_annotations.dart with
package:ack/format_annotations.dart.@Pattern is renamed @Matches, matching Ack.string().matches(...).
Pattern remains a deprecated alias in package:ack/annotations.dart only.
Until 2.0.0, an unprefixed import of that library hides dart:core's
Pattern in the file; import it as ack, or with hide Pattern, where the
file needs dart:core's Pattern.package:ack/ack.dart or package:ack/annotations.dart
can clash with same-named classes from other libraries, such as
package:uuid's Uuid or package:meta's Required. Import
package:ack/annotations.dart with a prefix (as ack, then @ack.Uuid()),
or hide the name from one import.ack no longer depends on json_annotation and no longer re-exports
JsonKey. To rename one field with @JsonKey(name: ...), import
package:json_annotation/json_annotation.dart and add json_annotation to
the app's dependencies; caseStyle needs neither.
AckModel.jsonSerializable and AckGeneratedJson.config are removed.@Schemable() is the single code-generation annotation: on a top-level
schema it generates a model, and on a class it generates a schema.
Schemable.generatedJson marks generated schema-first models.@AckInfer() and @AckModel(); use @Schemable() with the same options.
They will be removed in 2.0.0.AckModelAdapter.modelSchema decodes a schema-first boundary value to its generated model and encodes the model through the source schema.
AckModelAdapter.modelSchema decodes a schema-first boundary value to its
generated model and encodes the model through the source schema.CodecSchema.canEncode reports whether a codec has its own encoder: false
for a one-way transform, true for a codec built with an encoder. It does
not inspect the schemas a codec wraps.This coordinated release publishes ack, ack_annotations, ack_generator, ack_json_schema_builder, ack_mcp_dart, and ack_firebase_ai at version 1.6.2.
This coordinated release publishes ack, ack_annotations, ack_generator, ack_json_schema_builder, ack_mcp_dart, and ack_firebase_ai at version 1.6.2.
Ack.fromJsonSchema() now compiles the standard pattern keyword, restoring import of schemas exported from Ack. It uses an unanchored ECMA-262 search on strings and rejects invalid regular expressions at import time.Ack.fromJsonSchema() now accepts the standard propertyNames keyword to validate each object key against its subschema. Both keywords round-trip through Draft-7 export unchanged.The other five packages are version aligned and have no source or public API changes from 1.6.1. Compatible sibling dependency minimums remain unchanged.
See the publishing guide and changelogs for details.
Ack.fromJsonSchema() now compiles the pattern keyword, restoring import
of schemas exported from Ack. It uses an unanchored ECMA-262 search on
strings and rejects invalid regular expressions at import time.Ack.fromJsonSchema() now accepts the standard propertyNames keyword to
validate every key of an object instance against its subschema. Both
keywords round-trip through the Draft-7 export unchanged, raising the pinned
upstream conformance selection to 631 cases.Honor effective nullability consistently across unions, defaults, boundaries, codecs, object properties, and list-item validation.
All six ACK packages are aligned at 1.6.1. See the core package changelog for compatibility details and migration guidance.
safeParseAs documentation: mapper Exceptions become
SchemaTransformError failures, while mapper Errors are rethrown with
their original stack trace (the documented behavior never matched the code).isNullable flag. A union with a nullable branch, and any DefaultSchema,
BoundarySchema, or codec wrapping one, now encodes null wherever it
already parsed null: at the root, as an object property, and when nested
in another union. .transform(), .codec(), and Ack.codec() no longer
reject null on parse or encode when their input schema accepts it, which
matches the type: null branch their export already advertised.null now
encodes a present null as {"key": null} instead of omitting the key. A
missing key is still omitted.Ack.list(...) now throws its existing "nullable item schemas"
ArgumentError for item schemas whose null acceptance was previously hidden
behind a wrapper — a nested nullable union, or a codec, withDefault(...),
or Ack.preserveBoundary(...) over a nullable union.Ack.preserveBoundary(...) over a nullable union now exports an
outer {"type": "null"} branch, matching the null it accepts. The branch
is redundant with the union's own nullable branch but remains valid Draft-7.Error thrown by an encoder now propagates out of safeEncode with its
original stack trace at every nesting level. Previously only a root codec
rethrew: nested in Ack.object, Ack.list, Ack.map, or
Ack.discriminated the Error became a SchemaEncodeError failure, and in
Ack.anyOf it was swallowed entirely so a later branch could return ok. A
union no longer tries later branches once a branch encoder raises an
Error. To signal a value a codec cannot encode, throw an Exception or
express the rule with an output: schema; do not catch Error..min(Duration(seconds: 5)) used to
export minimum: 5000 while encoding 5. They are still enforced at
runtime, and the export now carries a
codec_runtime_constraint_not_exported warning naming the omitted
constraint keys. Move rules the wire should advertise onto the input schema
(Ack.string().minLength(5).codec(...)). Ack.duration().min()/.max()
still export minimum/maximum in milliseconds.Add strict Ack.fromJsonSchema() returning AckSchema for a documented draft 2020-12 subset. The runtime implementation is internal; failures expose imm
Ack.fromJsonSchema() returning AckSchema<Object, Object> for a
documented draft 2020-12 subset. The runtime implementation is internal;
failures expose immutable diagnostics through JsonSchemaImportException.
Supports supplied reference bundles, recursion, JSON-specific null/presence
semantics, and exact allOf, oneOf, and not composition. Exports are
self-contained and reflect only enforced assertions.$defs, normalize enums for valid Draft-7 output, and report unsupported
assertions only when they are reachable from the imported root.#).Ack.lazy() targets instead of exporting a reference to the wrong schema.$anchor keyword rather than at
the enclosing resource identifier.AckSchemaModel hierarchy. Imported roots use the
existing composition and reference models.Add Ack.map(valueSchema) and MapSchema for JSON objects with arbitrary string keys whose values all match one schema. Values may be null only when the
Ack.map(valueSchema) and MapSchema for JSON objects with arbitrary
string keys whose values all match one schema. Values may be null only
when the value schema is nullable, so Ack.map(Ack.any().nullable()) models
a JsonMap. JSON Schema export emits additionalProperties: <value schema>.Ack.any() parsing now returns a detached, recursively unmodifiable
snapshot of the input instead of the caller's own object, matching the
unmodifiable results of Ack.object() and Ack.list(). Encoding still
returns the validated runtime value unchanged.@AckField(presence: ...) remains during migration and is deprecated for removal in 2.0.0.
Ack 1.4 adds @Optional(), @Required(), and @NotNull() so class-first
models can override JSON key presence independently of whether a present
value may be null. @AckField(presence: ...) remains during migration
and is deprecated for removal in 2.0.0.
null on a nullable Dart field with @NotNull().copyWith from the constructor type so optional non-nullable
codec fields compile and do not receive null.All six packages use version 1.4.0: ack, ack_annotations, ack_generator,
ack_firebase_ai, ack_json_schema_builder, and ack_mcp_dart.
The runtime, Firebase, JSON Schema, and MCP packages have no runtime or
public API changes from 1.3.0.
Ack 1.3 adds ack_mcp_dart, a small adapter that uses one ACK input contract for MCP tool discovery and runtime argument parsing with mcp_dart ^2.4.2.
Ack 1.3 adds ack_mcp_dart, a small adapter that uses one ACK input contract for
MCP tool discovery and runtime argument parsing with mcp_dart ^2.4.2.
All six packages use version 1.3.0: ack, ack_annotations, ack_generator,
ack_firebase_ai, ack_json_schema_builder, and ack_mcp_dart.
The existing five packages have no runtime or public API changes from 1.2.0,
and compatible dependency minimums remain at ^1.2.0.
Release tooling now uses Melos fixed versions and a shared workspace tag, compares APIs with 1.2.0, and supports resuming a partially completed publication.
ack_mcp_dart;
this package has no runtime or public API changes from 1.2.0.docs: align contracts and Firebase fixture dependencies by @leoafarias in https://github.com/conceptadev/ack/pull/126
Full Changelog: https://github.com/conceptadev/ack/compare/v1.1.0...v1.2.0
Full Changelog: v1.1.0...v1.2.0
AckModelAdapter as the non-nullable runtime bridge used by generated
immutable Ack models. The adapter keeps schema parse/encode around model
mapping so public JSON methods remain schema-backed.Ack.preserveBoundary, which validates through a schema while returning
the original wire value instead of values decoded by nested codecs.deepUnmodifiableJsonMap, which creates detached, recursively
unmodifiable snapshots of nested maps, lists, and sets without validation.Error objects during validation instead of converting
programming defects into recoverable schema failures.int and double values now compare and
hash equally on native and web runtimes; other scalar types remain distinct.deepHashCode, and apply JSON
Schema Draft 7 numeric equality to uniqueItems (including nested values)..safe() without overflowing abs().deepEquals, deepHashCode, and deepUnmodifiableJsonMap for
generated Ack data classes and class-first constructors.Ack.integer() accepts losslessly representable numbers with no fractional
part and normalizes them to int. Ack.double() accepts exactly
representable numeric inputs and normalizes them to double. Numeric
anyOf branches can therefore overlap; the first matching branch determines
the runtime representation. Use Ack.number() to preserve the input's
numeric representation and .safe() to require JavaScript's portable
integer range.Ack 1.1.0 is a correctness-focused release that aligns runtime validation, generated schemas, and tooling with their documented contracts. It does not
Ack 1.1.0 is a correctness-focused release that aligns runtime validation, generated schemas, and tooling with their documented contracts. It does not change the public Dart API surface.
safeParse non-throwing for recoverable callback exceptions while
preserving Dart Error values so programming defects remain visible.t and z separators.multipleOf, IPv6, RFC 3339 date-times, range bounds, collection
limits, unions, and enum definitions consistently with JSON Schema.allOf, and export exact
list/object sizes with the correct Draft-7 keywords.source_gen diagnostics without undeclared debug-file output.Although the public API is unchanged, invalid or ambiguous inputs that were previously accepted may now fail earlier:
ArgumentErrors.Ack.list(item).nullable()), not its item.multipleOf.toJsonSchema().AckException from parse() when a recoverable constraint or
refinement callback throws; inspect the underlying cause for diagnostics.See the package changelogs for the complete behavior notes.
safeParse non-throwing when refinements or constraints throw
recoverable Exceptions, while preserving Error values such as
StateError so programming defects are not masked as validation failures.t/z separators in Ack.datetime(), which its
own string validation already accepts (previously they failed at the decode
step with a misleading "Codec decode failed" message).No public API changed (verified with dart_apitool against 1.0.1); the following
now reject inputs that previously passed or misbehaved silently.
multipleOf, IPv6, and RFC 3339 date-time values strictly.
Announced leap seconds are preserved by Ack.string().datetime() but rejected
by Ack.datetime(), where Dart cannot represent them. (migration: some
previously-accepted strings and numbers now fail validation.)min > max ranges,
multipleOf <= 0, empty unions, empty or duplicate enum inputs, and unions
that can yield nullable list items — all throw ArgumentError. (migration:
fix the schema definition; put nullability on the list via
Ack.list(item).nullable().)toJsonSchema() merges conflicting duplicate keywords into allOf and emits
min/maxItems and min/maxProperties for exact counts. (migration: refresh
snapshot or golden tests of exported schemas.)parse() throws AckException — instead of the raw callback error — when a
constraint or refinement throws.This patch hardens recursive schemas built with Ack.lazy against unbounded recursion.
This patch hardens recursive schemas built with Ack.lazy against unbounded recursion.
Ack.lazy / LazySchema (#122): recursive schemas now
enforce a maximum recursion depth (default 100) on parse, runtime validation, and
encode. Previously, cyclic or arbitrarily deep input could recurse without bound and
risk a stack overflow. Exceeding the limit now fails fast with a descriptive validation
error (lazy_max_depth: "Maximum recursion depth (N) exceeded.") instead of crashing.Ack.lazy(...) accepts an optional maxDepth (default LazySchema.defaultMaxDepth
= 100; must be >= 1), carried through copyWith, equality, and serialization.maxDepth check can't be expressed via
$ref and is omitted from the exported schema.Behavior note: recursion is now capped at depth 100 by default. Structures that legitimately nest deeper must pass an explicit higher
maxDepth.
The other packages (ack_annotations, ack_generator, ack_json_schema_builder,
ack_firebase_ai) are version-aligned to 1.0.1 with no functional changes.
Ack 1.0.0 is the first stable release of Ack, a schema validation library for Dart and Flutter. Ack helps you validate untrusted data at application b
Ack 1.0.0 is the first stable release of Ack, a schema validation library for Dart and Flutter. Ack helps you validate untrusted data at application boundaries, reuse the same schemas across runtime validation and JSON workflows, and generate typed wrappers when you want stronger ergonomics than map access.
Start with the documentation site or jump straight into the Quickstart Tutorial.
safeParse, SchemaResult, structured paths, and readable validation messages.@AckType() for extension types, typed getters, parse, and safeParse.toJsonSchema() and the reusable schema-model boundary for adapter authors.ack: core runtime validation library.ack_annotations: @AckType() annotation package.ack_generator: build_runner generator for typed schema wrappers.ack_json_schema_builder: adapter for json_schema_builder.ack_firebase_ai: Firebase AI structured-output schema adapter.Ack also publishes an llms.txt index with a compact overview of the packages, core APIs, code generation workflow, and common examples.
This release was validated with the full package test suites, documentation checks, example tests, and pub.dev dry-runs before publishing. All five packages are now available on pub.dev at version 1.0.0.
DoubleSchema and NumberSchema now reject non-finite values (NaN, Infinity, -Infinity) during runtime validation by default, aligning numeric schemas w
ackBreaking
DoubleSchema and NumberSchema now reject non-finite values (NaN, Infinity, -Infinity) during runtime validation by default, aligning numeric schemas with JSON-safe values.AckSchemaModel variants and a canonical AckSchema.toSchemaModel() adapter conversion.Added
Ack.enumCodec<T extends Enum>(List<T> values) returns a CodecSchema<String, T> wrapping EnumSchema<T>.NumberSchemaExtensions adds fluent numeric constraints to Ack.number(): .min, .max, .greaterThan, .lessThan, .positive, .negative, .multipleOf.Changed
Migration
double/num values. If a boundary must accept NaN/infinities, model that value outside the JSON numeric schema path before validation.ack_annotationsBreaking — Removed AckModel, AckField, and decorator annotations. Only @AckType() remains.
ack_generatorBreaking — Removed class-based schema generation. Only top-level @AckType() schema variables and getters are supported.
ack_firebase_aitoFirebaseAiResponseJsonSchema() for Firebase AI's GenerationConfig.responseJsonSchema path, plus committed golden fixtures and native fixture corpora.Schema conversion APIs — use toFirebaseAiResponseJsonSchema() instead.ack_json_schema_builderAckSchemaModel boundary and generic Draft-7 JSON Schema renderer; preserves defaults, const values, extension keywords, transformed metadata, and composition.All five packages are released in lockstep at 1.0.0-beta.12.
DoubleSchema and NumberSchema now reject non-finite values (NaN,
Infinity, -Infinity) during runtime validation by default, aligning
numeric schemas with JSON-safe values.AckSchemaModel variants and canonical AckSchema.toSchemaModel()
adapter conversion.Ack.enumCodec<T extends Enum>(List<T> values) returns a
CodecSchema<String, T> wrapping EnumSchema<T>. Use this when downstream
code expects every value-shape to be a CodecSchema (e.g. a registry of
codecs). Decode/encode are identity since EnumSchema already maps between
T and the enum's .name.NumberSchemaExtensions adds fluent numeric constraints to Ack.number():
.min, .max, .greaterThan, .lessThan, .positive, .negative, and
.multipleOf.double/num values. If a
boundary must accept NaN or infinities, model that value outside the JSON
numeric schema path before validation.chore(release): bump to 1.0.0-beta.11
chore(release): bump to 1.0.0-beta.11 (#102)
docs: add ack package README for pub.dev
docs: add ack package README for pub.dev (#98)
chore(release): bump to 1.0.0-beta.9
chore(release): bump to 1.0.0-beta.9 (#88)
ack_json_schema_builder@1.0.0-beta.8
This release adds top-level enum/literal schema constructors, deprecates chained string schema methods, and improves the code generator's nested schem…
This release adds top-level enum/literal schema constructors, deprecates chained string schema methods, and improves the code generator's nested schema resolution.
Ack.enumString(), Ack.literal(), and Ack.enumValues() constructors for creating enum and literal schemas directly (#73)SchemaResult.map() for transforming validated valuesStringSchema.literal() and StringSchema.enumString() are deprecated — use Ack.literal() and Ack.enumString() instead (#74)| Package | Version |
|---|---|
| ack | 1.0.0-beta.7 |
| ack_annotations | 1.0.0-beta.7 |
| ack_generator | 1.0.0-beta.7 |
| ack_firebase_ai | 1.0.0-beta.7 |
| ack_json_schema_builder | 1.0.0-beta.7 |
refactor: deprecate withDescription in favor of describe by @leoafarias in https://github.com/btwld/ack/pull/46
Full Changelog: https://github.com/btwld/ack/compare/0.3.0-beta.1...v1.0.0-beta.6
AckSchema.parseAs and AckSchema.safeParseAs for validated-value mapping with consistent SchemaTransformError handling.refactor: deprecate withDescription in favor of describe by @leoafarias in https://github.com/btwld/ack/pull/46
Full Changelog: https://github.com/btwld/ack/compare/0.3.0-beta.1...v1.0.0-beta.5
== and hashCode for structural comparison.meta and test dependencies to latest versions (#56).`withDescription` deprecated: Use describe() instead for setting schema descriptions.
email, uri, uuid, date, dateTime, ipv4, ipv6). Custom format strings are still supported via the format property.withDescription deprecated: Use describe() instead for setting schema descriptions.anyOf/oneOf compositions when nullable: true, producing valid JSON Schema Draft-07 format.REFACTOR: simplify validation workflow by eliminating duplicate nullable handling (#17).
* See release notes for details.
Multiple constraint classes have been deprecated in favor of unified ComparisonConstraint and PatternConstraint implementations:
melos api-check command replaces 19 complex shell commandsMultiple constraint classes have been deprecated in favor of unified ComparisonConstraint and PatternConstraint implementations:
String Constraints (use PatternConstraint instead):
StringDateTimeConstraint → PatternConstraint.dateTime()StringDateConstraint → PatternConstraint.date()StringEnumConstraint → PatternConstraint.enumValues()StringEmailConstraint → PatternConstraint.email()StringRegexConstraint → PatternConstraint.regex()StringJsonValidator → PatternConstraint.json()Numeric Constraints (use ComparisonConstraint instead):
NumberMinConstraint → ComparisonConstraint.numberMin()NumberMaxConstraint → ComparisonConstraint.numberMax()NumberRangeConstraint → ComparisonConstraint.numberRange()NumberExclusiveMinConstraint → ComparisonConstraint.numberExclusiveMin()NumberExclusiveMaxConstraint → ComparisonConstraint.numberExclusiveMax()NumberMultipleOfConstraint → ComparisonConstraint.numberMultipleOf()Collection Constraints (use ComparisonConstraint instead):
StringMinLengthConstraint → ComparisonConstraint.stringMinLength()StringMaxLengthConstraint → ComparisonConstraint.stringMaxLength()ListMinItemsConstraint → ComparisonConstraint.listMinItems()ListMaxItemsConstraint → ComparisonConstraint.listMaxItems()ObjectMinPropertiesConstraint → ComparisonConstraint.objectMinProperties()ObjectMaxPropertiesConstraint → ComparisonConstraint.objectMaxProperties()parse() and tryParse()All deprecated APIs remain functional with migration guidance. See the deprecations for detailed migration paths.
Full Changelog: https://github.com/btwld/ack/compare/v0.2.0-beta.1...0.3.0-beta.1
Packages with breaking changes:
Packages with other changes:
Packages with dependency updates only:
Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
ack_example - v0.3.0-beta.2This release introduces significant improvements to the SchemaModel API, enhanced string validation, and better OpenAPI integration.
This release introduces significant improvements to the SchemaModel API, enhanced string validation, and better OpenAPI integration.
Annotate your models with validation rules:
@Schema()
class Product {
@IsNotEmpty()
final String id;
@MinLength(3)
final String name;
final double price;
final Category category;
Product({
required this.id,
required this.name,
required this.price,
required this.category,
});
}
Use the build_runner to generate schema classes:
dart run build_runner build --delete-conflicting-outputs
This creates a .schema.dart file with your generated schemas.
The constructor now validates data automatically:
// Create schema with automatic validation
final schema = ProductSchema({
'id': '123',
'name': 'Test Product',
'price': 19.99
});
// Check if valid
bool valid = schema.isValid;
Access validated data with type-safe getters:
// Type-safe access to properties
String id = schema.id;
String name = schema.name;
double price = schema.price;
// Access nested schema objects
CategorySchema category = schema.category;
String categoryName = category.name;
Get detailed error information when validation fails:
if (!schema.isValid) {
SchemaError? error = schema.getErrors();
// Error details
String errorType = error?.name; // e.g., "required_field"
String message = error?.message; // e.g., "Required field is missing"
String? path = error?.path; // e.g., "category.id"
}
Transform schema data to strongly-typed models:
// Convert schema to model instance
Product product = schema.toModel();
// Access model properties
String id = product.id;
Category category = product.category;
Choose your preferred validation style:
// Approach 1: Constructor + isValid check
final schema = ProductSchema(data);
if (schema.isValid) {
final product = schema.toModel();
}
// Approach 2: Direct parse (throws on failure)
try {
Product product = ProductSchema.parse(data);
} catch (e) {
// Handle validation error
}
// Approach 3: Try-parse (returns null on failure)
Product? product = ProductSchema.tryParse(data);
if (product != null) {
// Use valid product
}
Convert model instances to schemas for serialization:
// Create schema from model instance
final schema = ProductSchema.fromModel(product);
// Serialize to various formats
Map<String, Object?> map = schema.toMap();
String json = schema.toJson();
The matches() method now validates entire strings:
// Full string pattern matching (with anchors)
final schema = Ack.string.matches('^[a-z0-9_]{3,16}$');
schema.validate('user_123').isOk; // true
schema.validate('user@123').isOk; // false - contains @
New contains() method for substring matching:
// Partial string matching
final schema = Ack.string.contains('important');
schema.validate('This is important text').isOk; // true
schema.validate('Nothing here').isOk; // false
Generate API specifications from your schemas:
// Get JSON Schema
Map<String, Object?> jsonSchema = ProductSchema.toJsonSchema();
// Convert to JSON string
String jsonString = jsonEncode(jsonSchema);
If you're upgrading from 0.1.x, note these changes:
Update string pattern validation:
// Old (0.1.x): Matches substrings
Ack.string.matches('abc'); // Would match 'abcdef'
// New (0.2.0): Matches whole string
Ack.string.matches('^abc$'); // Only matches 'abc' exactly
Ack.string.contains('abc'); // Matches substrings, like old matches()
Use the new validation workflow:
// Create and validate in one step
final schema = ProductSchema(data);
// Check isValid before using
if (schema.isValid) {
schema.id; // Access schema properties
schema.category.name; // Access nested properties
// Or convert to model
final product = schema.toModel();
}
Full documentation is available at https://docs.page/btwld/ack
0.2.0-beta.1.Packages with breaking changes:
Packages with other changes:
Nothing published for this version
Full Changelog: https://github.com/leoafarias/ack/compare/0.1.0...0.1.1
Full Changelog: https://github.com/leoafarias/ack/compare/0.1.0...0.1.1
Feature/better error handling by @leoafarias in https://github.com/leoafarias/ack/pull/1
Full Changelog: https://github.com/leoafarias/ack/compare/0.0.2...0.1.0
Better json response parsing for OpenApiSchemaConverter
Full Changelog: https://github.com/leoafarias/ack/compare/0.0.1...0.0.2
Initial release Full Changelog: https://github.com/leoafarias/ack/commits/0.0.2
Initial release
Full Changelog: https://github.com/leoafarias/ack/commits/0.0.2
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per month.