ack_example 1.0.0-beta.1
ack_example: ^1.0.0-beta.1 copied to clipboard
Example project for ACK schema generation.
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.