Built Value Converter
Last updated
Last updated
Experimental
A Chopper Converter for built_value based serialization.
Add the chopper_built_value package to your project's dependencies in pubspec.yaml:
Define your models as you usually do with built_value.
Aggregate all serializers into a top level collection.
See built_value documentation for more information on how built_value works.
Build a BuiltValueConverter
by providing the built_value
serializer collection.
To use the created converter, pass it to ChopperClient
's converter
constructor parameter.
BuiltValueConverter
is also an error converter. It will try to decode error response bodies using the wireName
inside JSON {"$":"ErrorModel"}
, if available.
If wireName
is not available, BuiltValueConverter
will try to convert error response bodies to errorType
, if it was provided and is not null
.