exaby73/luthor(新しいタブで開きます)
主要言語: Dart
Pure Dart validation library inspired by https://zod.dev
- star 数
- 29
- watcher 数
- 3
- fork 数
- 7
- issue 数
- 15
- 最終更新
- 2026/10/25
主要言語: Dart
Pure Dart validation library inspired by https://zod.dev
Luthor is a Dart validation library inspired by Zod. You build a schema with a fluent API, validate any value against it, and get typed data or a list of issues with flat error paths. luthor_generator writes the schemas for your json_serializable, freezed, and dart_mappable models.
import 'package:luthor/luthor.dart'; final user = l.schema({ 'email': l.string().email().required(), 'age': l.int().min(18), }); void main() { switch (user.validate({'email': 'ada', 'age': 16})) { case ValidationSuccess(:final data): print(data); case ValidationFailure(:final errors): print(errors); } }
This prints {email: [email must be a valid email address], age: [age must be greater than or equal to 18]}.
luthor is the validation library. It has no runtime dependencies.luthor_generator generates schemas for classes annotated with @luthor.Both need Dart 3.11 or later, or Flutter 3.41 or later.
The full documentation is at luthor.ex3.dev.
To teach your coding agent the Luthor API, install the Luthor agent skill with npx skills add exaby73/luthor.
Read AGENTS.md for the repository's rules and gotchas, and docs/architecture.md for how the runtime and the generator fit together.