dart_json_schema 2.1.0
dart_json_schema: ^2.1.0 copied to clipboard
A Dart/Flutter package that provides simple @Field and @JsonSchema annotations for adding metadata to model fields and classes, and generates standard JSON schemas using a command-line tool.
Use this package as an executable
Install it
You can install the package from the command line:
dart pub global activate dart_json_schema
Use it
The package has the following executables:
$ dart_json_schema
Use this package as a library
Depend on it
Run this command:
With Flutter:
$ flutter pub add dart_json_schema
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
dart_json_schema: ^2.1.0
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:dart_json_schema/dart_json_schema.dart';