diff --git a/chopper/lib/src/annotations.dart b/chopper/lib/src/annotations.dart index 3b592a22..d2840277 100644 --- a/chopper/lib/src/annotations.dart +++ b/chopper/lib/src/annotations.dart @@ -262,9 +262,14 @@ class Head extends Method { ); } +/// A function that should convert the body of a [Request] to the HTTP representation. typedef ConvertRequest = FutureOr Function(Request request); +/// A function that should convert the body of a [Response] from the HTTP +/// representation to a Dart object. typedef ConvertResponse = FutureOr Function(Response response); +/// A helper class for wrapping a request and a response converter. +/// See [ConvertRequest], [ConvertResponse]. @immutable class FactoryConverter { final ConvertRequest request; @@ -276,7 +281,7 @@ class FactoryConverter { }); } -/// Define a field for a `x-www-form-urlencoded` request. +/// Defines a field for a `x-www-form-urlencoded` request. /// Automatically binds to the name of the method parameter. /// /// ```dart