ack_example 1.0.0-beta.1 copy "ack_example: ^1.0.0-beta.1" to clipboard
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 Ack API
  • 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 anyOf and discriminated unions
  • Flexible Schemas: Using AnySchema for maximum flexibility

Running the Example #

  1. Bootstrap the Workspace: Ensure you have bootstrapped the monorepo from the root directory:

    # From the root directory ../../
    melos bootstrap
    
  2. Run the Examples:

    cd example
    dart run any_schema_example.dart
    
  3. 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.

0
likes
130
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

Example project for ACK schema generation.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

ack, ack_annotations

More

Packages that depend on ack_example