schemantic
Installation
SKILL.md
Schemantic
Schemantic is a general-purpose Dart library used for defining strongly typed data classes that automatically bind to reusable runtime JSON schemas. It is standard for the genkit-dart framework but works independently as well.
Core Concepts
Always use schemantic when strongly typed JSON parsing or programmatic schema validation is required.
- Annotate your abstract classes with
@Schema(). - Use the
$prefix for abstract schema class names (e.g.,abstract class $User). - Always run
dart run build_runner buildto generate the.g.dartschema files.
Basic Usage
- Defining a schema:
import 'package:schemantic/schemantic.dart';
Related skills