acanthis 2.0.0
acanthis: ^2.0.0 copied to clipboard
Acanthis is an easy-to-use validation library for Dart and Flutter.
Changelog #
2.0.0 #
-
breaking: remove
AcanthisParseResultandtoOutcome().parse/parseAsyncreturn raw values;tryParse/tryParseAsyncreturn sealedAcanthisValid/AcanthisInvalidoutcomes. Both outcome branches exposevalue; invalid values are best-effort output, not validated data. -
feat:
validate/validateAsyncreturn the first validation message or null, for field validation. Async checks require the asynchronous entry points. -
feat: Add typed per-call context, selected-field rules with declared paths and conditional presence, and independent field/object collection policies.
-
feat: Add atomic batches, nested edits, removal, revision snapshots, issue additions and removals, and dependency-aware reuse to live sessions.
-
feat: Add async field pending state, debounce, cooperative cancellation, and disposal.
-
refactor: Reject exact schema export for selected-field predicates.
-
perf: resolve typed string-list executors once per batch and reduce first-use object-plan setup, retaining dynamic-list and subclass fallbacks.
-
perf: reduce diagnostic metadata and path copying, avoid exception-based string type rejection, simplify single-check executors, and reduce flat-schema setup and primitive-list parsing overhead while preserving ordered issues and recovery behavior.
-
feat: extend audited input/output JSON Schema 2020-12 and OpenAPI 3.1 exports with numeric bounds, scalar equality/enumeration, boolean checks, nonempty strings, list lengths, and stable recursive object references. Keep repeated constraints conjunctive and diagnose unaudited semantics explicitly.
-
test: verify 1,620 runtime/input pairs and successful outputs with independent JSON Schema and OpenAPI validators; add a repeatable export audit runner.
-
breaking: separate required nullable fields from optional presence; validate defaults for absent/null input consistently across execution modes. Preserve nullable nulls and keep invalid-input recovery unsuccessful.
-
breaking:
partial()now preserves omission, nullability and unknown-key policy; addpatch()alias and suppress defaults only for omitted PATCH fields. -
feat: add explicit strip/preserve/reject unknown-key policies and structural input/output exports for JSON Schema 2020-12 and OpenAPI 3.1, with diagnostics for unsupported behavior.
-
fix: preserve defaulted field values in live recovery without repeating transformations; validate pipeline defaults on their output side.
-
fix: export ordinary OpenAPI unions using
anyOfso inputs matching multiple branches remain valid. -
docs: record native issue compatibility, an executable presence/default/export audit, and selected-field rule design before changing live scheduling.
-
test: add reproducible differential validation and lifecycle benchmarks for JIT/AOT, invalid inputs, large unions, transformed outputs, live updates, controlled async callbacks, and separate allocation/CPU profiling.
-
feat: add
mockSeededwith a documented supported subset, validation guarantees, resource limits and explained failures; bound the legacy list mock loop. -
fix: align sync/async recovery output, nested stripping, absent optional fields, and container sharing. Type-failure fallback mocking now uses a fixed seed for reproducible recovery.
-
feat: emit ordered structured issues directly, retaining duplicate failures, typed data paths, constraint parameters, and nested union branch diagnostics. Add field/tree/JSON formatters and presentation-time message resolvers; keep
errorsas a lossy compatibility projection. -
fix: finalize the unreleased 2.0 path contract (
/account/email, without a trailing check name), preserve diagnostics across async composition and live updates, and omit input values from built-in coercion messages. Missing dependencies use a stabledependencycode. -
perf: reuse input maps and typed lists when validation leaves them unchanged. Parsed values can now share identity with their input; transformations, coercion, defaults, and unknown-key stripping retain their output handling.
-
feat: add
watchandwatchAsyncextensions on object schemas for synchronous and asynchronous live validation sessions. Synchronous sessions exposeexplain(field); update deltas report executed fields and whether full validation ran. -
feat: add
validate/validateAsync, typed validation outcomes, and structured issues with paths and JSON pointers. -
perf: specialize eligible object schemas with inline primitive checks and flattened nested validation.
-
fix: execute object and list transformations once through async entry points, propagate nested stripped output without mutating input, and report invalid map/list inputs through non-throwing APIs.
-
breaking: require Dart 3.13 or later. Parsed maps/lists may share input identity; copy the returned container explicitly when independent mutable output is required. Unknown properties are stripped at every object level unless that level uses passthrough.
-
chore: update dependencies to ensure compatibility with the latest versions of Dart and Flutter, improving overall stability and performance of the library.
-
fix: resolve issues with asynchronous validation in sessions, ensuring that all asynchronous checks are properly handled and that validation results are accurate and reliable.
1.6.0 #
- feat: add coercion support for all types, allowing for automatic type conversion when parsing values. This feature enables more flexible and user-friendly validation by accepting different input formats and converting them to the expected type.
1.5.4 #
- fix: Prevent nullable to be treated always like a pure type and use type purity to determine if the schema is pure or not, allowing for more complex schemas to be nullable without losing their purity.
1.5.3 #
- perf: improve general performances
1.5.2 #
- feat: add
AcanthisType#mockto generate mocks values from the schema.
1.5.1 #
- feat: add dot-shorthand support for all types.
- feat: add
AcanthisIntegerandAcanthisDoubleto represent integer and double types separately. - feat: add
templatetype to create template literal schemas with placeholders.
1.5.0 #
- feat: add Open API schema generation for all types.
1.4.6 #
- feat: add
AcanthisType#defaultValueto get the default value of the schema. - chore:
metadependency is now less strict.
1.4.5 #
- feat: add
CustomCauseCheckto allow for custom checks that return a cause message on failure based on the input value.
1.4.4 #
- feat: pipes are now acanthis type and can be used to validate more complex structures.
- feat: date type accept now string, int and DateTime values.
1.4.3 #
- perf: improve performances again.
1.4.2 #
- chore: update dependencies
- perf: improved overall performances
1.4.1 #
- feat: add support for
literalvalues in objects, unions, tuples, list
1.4.0 #
- feat: add support for class schemas with
classSchema<I, T>() - feat: add support for instances validation with
instance<T>() - feat: add support for discriminated union with
union<T>()andvariant<T>()
1.3.2 #
- fix(#14): change list parse values to dynamic values #15 by francescovallone
1.3.1 #
- fix: wrong error messages for missing keys when parsing maps #13 by jesus-gueyp
1.3.0 #
1.2.3 #
- refactor: improve overall code quality and performance.
- feat: allow custom error message for all validators.
1.2.2 #
- refactor: add possiblity to use both String and RegExp for
AcanthisString#patternvalidator. - feat: add
AcanthisType#elementTypeto get the type of the schema.
1.2.1 #
- refactor: improve overall code quality and performance.
- remove 'fast_immutable_collections' dependency.
1.2.0 #
- feat: add
toJsonSchemamethod to generate JSON Schema from Acanthis Types. #10 by francescovallone - feat: add
tuplevalidator to create a tuple schema. #10 by francescovallone - feat: add several checks to multiple validators. #10 by francescovallone
- feat: add Metadata System to allow for adding metadata to schemas. #10 by francescovallone
1.1.0 #
- fix:
AcanthisMap.extendmethod now does not override existing key-value pairs. #7 by francescovallone - refactor: codebase is now immutable. #6 by dickermoshe
1.0.2 #
- Add
differsFromNowto theAcanthisDatevalidator. - Add
doubleandbetweento theAcanthisNumbervalidator. - Add
time,url,cardandhexColorto theAcanthisStringvalidator.
1.0.1 #
- Add
lazyvalidator to allow for recursive schemas.
1.0.0 #
- Upgrade dependencies.
- Add async checks for all validators to allow for a more flexible validation process.
- Add
partialvalidator to object validator. - Add more String validators.
- Rename
customChecktorefinein all validators. - Add
refineAsyncto all validators. - Add
pipeandAcanthisPipelineto allow for more complex validation and transformation processes.
0.1.3 #
0.1.2 #
- Add the
addFieldDependencyfunction to theobjectvalidator. - Add information about
addFieldDependencyin theobjectvalidator. - Remove the
Operationssection from the documentation.
0.1.1 #
Refactor #
- The function
jsonObjecthas been renamed asobject. - Add explicit information about the parse result object
AcanthisParseResult.
0.1.0 #
- Add the
nullablevalidator. - Add the
unionvalidator. - Add the
booleanvalidator. - Add transformation functions for all the validators except
nullable,booleanandunion. - Add tests for all the validators (100% coverage 🎉).
- Add documentation for all the validators.
- [#1] Fix the
string().email()validator that will now use theemail_validatorpackage.
0.0.1 #
- Initial version.