# google/json_serializable.dart

Generates utilities to aid in serializing to/from JSON.

Repository: https://github.com/google/json_serializable.dart
Canonical: https://ross.abutalabs.com/products/json_serializabledart
Homepage: https://pub.dev/packages/json_serializable
Language: Dart
License: BSD-3-Clause
License Family: permissive
Topics: source-gen, json, dart-build-system, dartlang
Last push: 2026-08-03T15:52:09+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 95, longevity 100
- inputs: {"age_days": 3333, "days_push": 30, "days_rel": 34, "gap_med": 27.0, "n_releases_24m": 23}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1618, forks 462 (observed 2026-08-28T04:05:12.122485+00:00)

## What it is
A Dart package that generates JSON serialization and deserialization code for Dart classes via annotations like @JsonSerializable and @JsonKey, using the Dart Build System (build_runner). It also includes _annotation for annotations, checked_yaml for better YAML decoding errors, and JsonLiteral/JsonEnum support.

## Use cases
- generate fromJson/toJson code for Dart classes
- serialize and deserialize models to JSON in Flutter apps
- customize JSON field names and defaults with annotations
- generate JSON Schema from Dart classes
- handle enum serialization to JSON values
- load JSON files as Dart literals at build time
- decode YAML with helpful error messages

## When to avoid
- your project is not Dart/Flutter
- you prefer runtime reflection-based serialization
- you need serialization formats other than JSON/YAML
- you cannot use build_runner code generation in your workflow

## Facets
- artifact type: library
- maturity: active
- function: serialization, parser, developer-tools
- domain: developer-tools, web-development, mobile-development, cross-platform
- platform: cross-platform, cli
- tags: dart, flutter, codegen, build-runner, source-gen, -annotation, -schema, mobile, web-server

## Member repositories
- google/json_serializable.dart (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:12.122485+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:49:38.364564+00:00, confidence not recorded.
  - readme: https://github.com/google/json_serializable.dart (fetched 2026-08-28T04:05:12.122485+00:00, sha 6f340cf9e288)
  - homepage: https://pub.dev/packages/json_serializable (fetched 2026-08-29T11:22:14.749803+00:00, sha d3cb6564c90e)
  - site_page: https://pub.dev/packages/json_serializable/install (fetched 2026-08-29T11:22:14.761889+00:00, sha d43b86813d58)
  - site_page: https://pub.dev/documentation/json_annotation/4.12.0/json_annotation/JsonSerializable-class.html (fetched 2026-08-29T11:22:14.763589+00:00, sha 81d28bdf1a1c)
  - site_page: https://pub.dev/documentation/json_annotation/4.12.0/json_annotation/JsonKey-class.html (fetched 2026-08-29T11:22:14.765299+00:00, sha 158b2cc64bd7)
  - site_page: https://pub.dev/documentation/json_annotation/4.12.0/json_annotation/JsonLiteral-class.html (fetched 2026-08-29T11:22:14.766905+00:00, sha a83804cfe970)
  - site_page: https://pub.dev/documentation/json_annotation/4.12.0/json_annotation/JsonEnum-class.html (fetched 2026-08-29T11:22:14.768486+00:00, sha de3091287c61)
  - site_page: https://pub.dev/documentation/json_annotation/4.12.0/json_annotation/JsonValue-class.html (fetched 2026-08-29T11:22:14.770372+00:00, sha e3586c9c5209)
  - site_page: https://pub.dev/documentation/json_annotation/4.12.0/json_annotation/JsonEnum/valueField.html (fetched 2026-08-29T11:22:14.771823+00:00, sha ea306198e9c7)
  - site_page: https://pub.dev/packages/json_serializable/changelog (fetched 2026-08-29T11:22:14.759129+00:00, sha ba14ff896619)
- Data as of 2026-08-30T08:39:29.467469+00:00.
