{"id":28089136,"url":"https://github.com/btwld/ack","last_synced_at":"2026-01-17T15:31:24.338Z","repository":{"id":279082021,"uuid":"937612393","full_name":"btwld/ack","owner":"btwld","description":"A modern Dart schema library for structured data, with a focus on LLM tools in mind.","archived":false,"fork":false,"pushed_at":"2026-01-09T18:59:14.000Z","size":1143,"stargazers_count":55,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T10:37:59.080Z","etag":null,"topics":["dart","openapi-specification","schema","validation"],"latest_commit_sha":null,"homepage":"https://docs.page/btwld/ack","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btwld.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-23T13:49:51.000Z","updated_at":"2026-01-09T18:59:16.000Z","dependencies_parsed_at":"2025-05-02T17:55:05.813Z","dependency_job_id":"964667ff-9ed3-4c58-a905-c06943f910ec","html_url":"https://github.com/btwld/ack","commit_stats":null,"previous_names":["leoafarias/ack","btwld/ack"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/btwld/ack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btwld%2Fack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btwld%2Fack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btwld%2Fack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btwld%2Fack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btwld","download_url":"https://codeload.github.com/btwld/ack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btwld%2Fack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","openapi-specification","schema","validation"],"created_at":"2025-05-13T12:54:06.777Z","updated_at":"2026-01-17T15:31:24.328Z","avatar_url":"https://github.com/btwld.png","language":"Dart","readme":"# Ack\n\n[![CI/CD](https://github.com/btwld/ack/actions/workflows/ci.yml/badge.svg)](https://github.com/btwld/ack/actions/workflows/ci.yml)\n[![docs.page](https://img.shields.io/badge/docs.page-documentation-blue)](https://docs.page/btwld/ack)\n[![pub package](https://img.shields.io/pub/v/ack.svg)](https://pub.dev/packages/ack)\n[![llms.txt](https://img.shields.io/badge/llms.txt-available-8A2BE2)](https://docs.page/btwld/ack/llms.txt)\n\nAck is a schema validation library for Dart and Flutter that helps you validate data with a simple, fluent API. Ack is short for \"acknowledge\".\n\n## Why Use Ack?\n\n- **Simplify Validation**: Easily handle complex data validation logic\n- **Ensure Data Integrity**: Guarantee data consistency from external sources (APIs, user input)\n- **Single Source of Truth**: Define data structures and rules in one place\n- **Reduce Boilerplate**: Minimize repetitive code for validation and JSON conversion\n- **Type Safety**: Generate type-safe schema classes from your Dart models\n\n## Packages\n\nThis repository is a monorepo containing:\n\n- **[ack](./packages/ack)**: Core validation library with fluent schema building API\n- **[ack_generator](./packages/ack_generator)**: Code generator for creating schema classes from annotated Dart models\n- **[ack_firebase_ai](./packages/ack_firebase_ai)**: Firebase AI (Gemini) schema converter for structured output generation\n- **[example](./example)**: Example projects demonstrating usage of all packages\n\n## Quick Start\n\n### Core Library (ack)\n\nAdd Ack to your project:\n\n```bash\ndart pub add ack\n```\n\nDefine and use a schema:\n\n```dart\nimport 'package:ack/ack.dart';\n\n// Define a schema for a user object\nfinal userSchema = Ack.object({\n  'name': Ack.string().minLength(2).maxLength(50),\n  'email': Ack.string().email(),\n  'age': Ack.integer().min(0).max(120).optional(),\n});\n\n// Validate data against the schema\nfinal result = userSchema.safeParse({\n  'name': 'John Doe',\n  'email': 'john@example.com',\n  'age': 30\n});\n\n// Check if validation passed\nif (result.isOk) {\n  final validData = result.getOrThrow();\n  print('Valid user: $validData');\n} else {\n  final error = result.getError();\n  print('Validation failed: $error');\n}\n```\n\nUse `.optional()` when a field may be omitted entirely. Chain `.nullable()` if a present field may hold `null`, or combine both for an optional-and-nullable value.\n\n### Advanced Usage\n\nFor more complex validation scenarios:\n\n```dart\nimport 'package:ack/ack.dart';\n\n// Complex nested object validation\nfinal orderSchema = Ack.object({\n  'id': Ack.string().uuid(),\n  'customer': Ack.object({\n    'name': Ack.string().minLength(2),\n    'email': Ack.string().email(),\n  }),\n  'items': Ack.list(Ack.object({\n    'product': Ack.string(),\n    'quantity': Ack.integer().positive(),\n    'price': Ack.double().positive(),\n  })).minLength(1),\n  'total': Ack.double().positive(),\n}).refine(\n  (order) {\n    // Custom validation: total should match sum of items\n    final items = order['items'] as List;\n    final calculatedTotal = items.fold\u003cdouble\u003e(0, (sum, item) {\n      final itemMap = item as Map\u003cString, Object?\u003e;\n      final quantity = itemMap['quantity'] as int;\n      final price = itemMap['price'] as double;\n      return sum + (quantity * price);\n    });\n    final total = order['total'] as double;\n    return (calculatedTotal - total).abs() \u003c 0.01;\n  },\n  message: 'Total must match sum of item prices',\n);\n\n// Validate complex data\nfinal result = orderSchema.safeParse(orderData);\nif (result.isOk) {\n  final validOrder = result.getOrThrow();\n  print('Valid order: ${validOrder['id']}');\n} else {\n  print('Validation failed: ${result.getError()}');\n}\n```\n\n## Documentation\n\nDetailed documentation is available at [docs.page/btwld/ack](https://docs.page/btwld/ack).\n\n## Development\n\nThis project uses [Melos](https://github.com/invertase/melos) to manage the monorepo.\n\n### Setup\n\n```bash\n# Install Melos (if not already installed)\ndart pub global activate melos\n\n# Bootstrap the workspace (installs dependencies for all packages)\nmelos bootstrap\n```\n\n### Common Commands (run from root)\n\n```bash\n# Run tests across all packages\nmelos test\n\n# Format code across all packages\nmelos format\n\n# Analyze code across all packages\nmelos analyze\n\n# Check for outdated dependencies\nmelos deps-outdated\n\n# Run build_runner for packages that need it (e.g., ack_generator, example)\nmelos build\n\n# Clean build artifacts\nmelos clean\n\n# Bump patch version (0.0.x)\nmelos version-patch\n\n# Bump minor version (0.x.0)\nmelos version-minor\n\n# Bump major version (x.0.0)\nmelos version-major\n\n# Dry-run publish (validation only)\nmelos publish-dry\n\n# Publish packages to pub.dev\nmelos publish\n```\n\n### Development Tools\n\nThe project includes additional development tools for maintainers:\n\n```bash\n# JSON Schema validation (ensures compatibility with JSON Schema Draft-7)\nmelos validate-jsonschema\n\n# API compatibility checking using Dart script (for semantic versioning)\nmelos api-check v0.2.0\n\n# See all available scripts\nmelos list-scripts\n```\n\n\u003e **Note**: Additional development documentation is available in the `tools/` directory for project maintainers.\n\n## Versioning and Publishing\n\nThis project uses GitHub Releases to manage versioning and publishing. For detailed instructions on how to create releases and publish packages, see [PUBLISHING.md](./PUBLISHING.md).\n\n## Contributing\n\nContributions are welcome! A detailed CONTRIBUTING.md file will be added soon with specific guidelines.\n\nIn the meantime, please follow these basic steps:\n1. Fork the repository\n2. Create a feature branch\n3. Add your changes\n4. Run tests with `melos test`\n5. Make sure to follow [Conventional Commits](https://www.conventionalcommits.org/) in your commit messages\n6. Submit a pull request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtwld%2Fack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtwld%2Fack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtwld%2Fack/lists"}