acanthis library

Classes

AcanthisBoolean
AcanthisDate
A class to validate date types
AcanthisList<T>
A class to validate list types
AcanthisLiteral<T>
AcanthisLiteral is a class that represents a literal value.
AcanthisMap<V>
A class to validate map types
AcanthisNullable<T>
A class to validate nullable types
AcanthisNumber
A class to validate number types
AcanthisParseResult<O>
A class to represent the result of a parse operation
AcanthisPipeline<O, T>
A class to represent a pipeline of transformations
AcanthisString
A class to validate string types
AcanthisTuple
AcanthisType<O>
A class to validate types
AcanthisUnion<T>
A union that can validate a value against multiple element types and/or guarded variants. Parsing succeeds with the first matching element / variant.
AcanthisVariant<T>
Represents a guarded variant inside a union. The guard decides if this variant should be attempted for a given value.
ClassSchemaBuilder<I, T>
Builder for class schemas (I -> T)
InstanceRefsBuilder<T>
InstanceType<T>
A validator for already constructed objects of type T. It validates properties (via getters) using existing AcanthisType validators and returns the original instance (no transformation performed).
LazyEntry<O>
MetadataEntry<T>
MetadataRegistry
RefAccessor<T>

Functions

boolean() AcanthisBoolean
Create a boolean validator
classSchema<I, T>() ClassSchemaBuilder<I, T>
Generic factory for arbitrary input type I -> T
date() AcanthisDate
Create a new date type
instance<T>() InstanceType<T>
Factory function to create an instance validator.
lazy<O>(AcanthisType<O> type(AcanthisMap parent)) LazyEntry<O>
literal<T>(T value) AcanthisLiteral<T>
Creates a new instance of AcanthisLiteral.
number() AcanthisNumber
Create a number type
object(Map<String, AcanthisType> fields) AcanthisMap
Create a map of fields
string() AcanthisString
Create a new AcanthisString instance
tuple(List<AcanthisType> elements) AcanthisTuple
Creates a new AcanthisTuple with the given elements.
union<T>(List elements) AcanthisUnion<T>
Factory for union of types / variants.
variant<T>({required bool guard(dynamic value), required AcanthisType<T> schema, String name = ''}) AcanthisVariant<T>
Factory to create a variant.

Exceptions / Errors

AsyncValidationException
BuildValidatorException
ValidationError
Error thrown when a validation fails.