Releases: google/built_value.dart
Releases · google/built_value.dart
Better error messages; fix for serialization with StandardJsonPlugin
- Add custom
Error
classes:BuiltValueNullFieldError
,BuiltValueMissingGenericsError
andBuiltValueNestedFieldError
. These provide clearer error messages on failure. In particular, errors in nested builders now report the enclosing class and field name, making them much more useful. - Fix serialization when using polymorphism with StandardJsonPlugin.
Bump quiver and built_collection versions
Allow quiver 27 and built_collection 3.
Fix for generation when using summaries
This will not affect anyone using the standard (pub) build.
Many features, improvements and fixes
New features:
- Add
serialize
field to@BuiltValueField
. Use this to tag fields to skip
when serializing. - Add
wireName
field to@BuiltValue
and@BuiltValueField
. Use this to
override the wire name for classes and fields when serializing. - Add
@BuiltValueEnum
and@BuiltValueEnumConst
annotations for specifying
settings for enums. AddwireName
field to these to override the wire names
in enums when serializing. - Add support for polymorphism to
StandardJsonPlugin
. It will now specify
type names as needed via adiscriminator
field, which by defualt is
called$
. This can be changed in theStandardJsonPlugin
constructor. - Add
BuiltListAsyncDeserializer
. It provides a way to deserialize large
responses without blocking, provided the top level serialized type is
BuiltList
. - Add built in serializer for
Uri
.
Improvements:
- Allow declaration of multiple
Serializers
in the same file. - Explicitly disallow private fields; fail with an error during generation if
one is found. - Improve error message for field without type.
Fixes:
- Fix generated builder when fields hold function types.
- Fix checks and generated builder when manually maintained builder has
generics. - Fix name of classes generated from a private class.
- Fix builder and serializer generation when importing with a prefix.
Support skipping fields for comparison
- New annotation,
BuiltValueField
, for configuring fields. First
setting available iscompare
. Set tofalse
to ignore a particular field
foroperator==
andhashCode
. - Generator now has a
const
constructor.
Fix for built_collection 2.0.0
The built_collection
package now has separate interfaces and implementations, which changes the runtimeType
of collection instances. Most people don't need to worry about this, but built_value
now needs to be a bit smarter about serialization.
Allow quiver 0.26
Merge pull request #259 from davidmorgan/bump-quiver Allow quiver 0.26. Release 4.3.3.
Fix generation with multiple levels of inheritance
v4.3.1 introduced a NPE when you have multiple levels of inheritance of interfaces; now fixed.
Fix generation with mixins
Support implement
ing an interface and at the same time providing a mixin that implements part of the interface.
Now, for such fields, no code is generated; they are concrete fields.
Support serializing Int64
Serialization now supports Int64 from package:fixnum.