built_json 0.1.5

  • README.md
  • Installing
  • Versions
  • 0

Built JSON for Dart #

Build Status

Introduction #

Built JSON provides serialization for the [Libraries for Object Oriented Dart] (https://github.com/google/built_value.dart/blob/master/libraries_for_object_oriented_dart.md#libraries-for-object-oriented-dart).

This allows a complete serializable object oriented data model to be based on Enum Classes, [Built Collections] (https://github.com/google/built_collection.dart#built-collections-for-dart) and [Built Values] (https://github.com/google/built_value.dart#built-values-for-dart).

Built JSON for Java, a separate project, will provide compatible serialization for Java, mapping Enum Classes to standard Java enums, Built Collections to [Immutable Collections] (https://github.com/google/guava/wiki/ImmutableCollectionsExplained) and Built Values to [AutoValues] (https://github.com/google/auto/tree/master/value#autovalue).

Status #

Built JSON is not yet ready for use. Watch this space!

Motivation #

There are many ways to serialize data. Why do we need another?

Built JSON is about serialization of object oriented data. There are many ways to do this, too. Built JSON is different to other libraries for a number of reasons:

Built JSON fully supports object oriented design: any object model that you can design can be serialized, including full use of generics and interfaces. Some other libraries require concrete types or do not fully support generics.

Built JSON allows different object oriented models over the same data. For example, in a client server application, it's likely that the client and server want different functionality from their data model. So, they are allowed to have different classes that map to the same data. Most other libraries enforce a 1:1 mapping between classes and types on the wire.

Built JSON requires well behaved types. They must be immutable, can use interface but not concrete inheritance, must have predictable nullability, hashCode, equals and toString. In fact, they must be Enum Classes, Built Collections or Built Values. Some other libraries allow badly behaved types to be serialized.

Built JSON supports changes to the data model. Optional fields can be added or removed, and fields can be switched from optional to required, allowing your data model to evolve without breaking compatbility. Some other libraries break compatability on any change to any serializable class.

Built JSON is modular. Each endpoint can choose which classes to know about; for example, you can have multiple clients that each know about only a subset of the classes the server knows. Most other libraries are monolithic, requiring all endpoints to know all types.

Built JSON is multi language. Support will be come first for Dart, Java and Java/GWT. Many other libraries support a single language only.

Built JSON has first class support for validation via Built Values. An important part of a powerful data model is ensuring it's valid, so classes can make guarantees about what they can do. Other libraries also support validation but usually in a less prominent way.

And, finally, Built JSON is pluggable. Arbitrary extensions can be added to give custom JSON serialization for your own types. This could be used to interoperate with other tools or to add hand coded high performance serializers for specific classes. Some other libraries are not so extensible.

Examples #

See [this example] (https://github.com/google/built_json.dart/tree/master/example) for a full project with a build.dart and some examples.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.1.5 #

  • Allow quiver 0.23.

0.1.4 #

  • Upgrade analyzer, build and source_gen dependencies.

0.1.3 #

  • Fix serialization when built_value builder is fully generated.

0.1.2 #

  • Fix issue with BuiltMap deserialization.

0.1.1 #

  • Fix error in pubspec.yaml.

0.1.0 #

  • Upgrade to source_gen 0.5.0.
  • Breaking change; see example for required changes to build.dart.

0.0.7 #

  • Allow non-serializable static types provided runtime types are serializable.

0.0.6 #

  • Fix serialization of null @nullable fields: omit them entirely.

0.0.5 #

  • Add PrimitiveSerializer and StructuredSerializer interfaces.

0.0.4 #

  • Update built_value dependency to 0.0.6.
  • Fix analyzer version constraints.

0.0.3 #

  • Stop falling back to "<Object>" for collection type parameters.
  • Extend code generation to add the builders needed for collections.
  • Differentiate Object from unspecified.

0.0.2 #

  • Rewrite to fully use static type information.

0.0.1 #

  • Generator, tests and example.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  built_json: ^0.1.5

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:built_json/built_json.dart';
Version Uploaded Documentation Archive
0.1.5 Oct 19, 2016 Go to the documentation of built_json 0.1.5 Download built_json 0.1.5 archive
0.1.4 Sep 21, 2016 Go to the documentation of built_json 0.1.4 Download built_json 0.1.4 archive
0.1.3 Sep 21, 2016 Go to the documentation of built_json 0.1.3 Download built_json 0.1.3 archive
0.1.2 Sep 12, 2016 Go to the documentation of built_json 0.1.2 Download built_json 0.1.2 archive
0.1.1 May 25, 2016 Go to the documentation of built_json 0.1.1 Download built_json 0.1.1 archive
0.1.0 May 25, 2016 Go to the documentation of built_json 0.1.0 Download built_json 0.1.0 archive
0.0.7 May 9, 2016 Go to the documentation of built_json 0.0.7 Download built_json 0.0.7 archive
0.0.6 May 5, 2016 Go to the documentation of built_json 0.0.6 Download built_json 0.0.6 archive
0.0.5 Mar 18, 2016 Go to the documentation of built_json 0.0.5 Download built_json 0.0.5 archive
0.0.4 Feb 23, 2016 Go to the documentation of built_json 0.0.4 Download built_json 0.0.4 archive

All 13 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

This package is not analyzed, because it is discontinued.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0