safe_json_annotation 0.2.2
safe_json_annotation: ^0.2.2 copied to clipboard
Runtime companion for safe_json_serializable — tolerant parse helpers and a re-export of json_annotation, so backend type changes never crash fromJson.
safe_json_annotation #
Runtime companion for safe_json_serializable — the tolerant parse
helpers (safeInt, safeString, …) that its generated code calls, plus a
re-export of json_annotation so this is the only serialization import
your models need.
Add it to your dependencies and see the safe_json_serializable
README for full setup and behaviour.
dependencies:
safe_json_annotation: ^0.2.2
dev_dependencies:
safe_json_serializable: ^0.3.0
build_runner: ^2.4.0
import 'package:safe_json_annotation/safe_json_annotation.dart';
part 'user.g.dart';
@JsonSerializable()
class User { /* … */ }
License #
MIT — see LICENSE.