Ack Example Package
This package demonstrates how to use the ack validation library for schema-based data validation.
Overview
The code within lib/ showcases:
- Defining validation schemas using the fluent
AckAPI - Validating complex nested data structures
- Using different schema types (string, number, object, list, etc.)
- Custom validation with refinements and transformations
- Error handling and validation results
Examples Included
- Basic Schema Validation: Simple string, number, and boolean validation
- Object Validation: Nested object structures with property validation
- List Validation: Array validation with item schemas
- Custom Validation: Using refinements for business logic validation
- Union Types: Using
anyOfand discriminated unions - Flexible Schemas: Using
AnySchemafor maximum flexibility
Running the Example
-
Bootstrap the Workspace: Ensure you have bootstrapped the monorepo from the root directory:
# From the root directory ../../ melos bootstrap -
Run the Examples:
cd example dart run any_schema_example.dart -
Run Tests: The tests demonstrate various validation scenarios:
# From the example directory dart test # Or run all workspace tests from the root directory ../../ melos test
Explore the code in lib/ and test/ to understand different validation patterns with Ack schemas.
Libraries
- anyof_example
- described_model
- discriminated_example
- edge_case_models
- enums
- mixed_examples
- product_model
- schema_types_edge_cases
- Edge case examples for schema variable type extraction
- schema_types_primitives
- schema_types_simple
- simple_examples
- status_model
- test_extension_types
- validation_test_model