Built Value Converter
Experimental
A Chopper Converter for built_value based serialization.
Installation
Add the chopper_built_value package to your project's dependencies in pubspec.yaml:
Getting started
Built value
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.
Using BuiltValueConverter with Chopper
Build a BuiltValueConverter
by providing the built_value
serializer collection.
To use the created converter, pass it to ChopperClient
's converter
constructor parameter.
Error converter
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
.
Last updated