Skip to content

Commit

Permalink
Update the documentation of ConvertRequest, ConvertResponse, and Fact…
Browse files Browse the repository at this point in the history
…oryConverter in annotations.dart
  • Loading branch information
stewemetal committed Nov 9, 2020
1 parent b807d7e commit d556993
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion chopper/lib/src/annotations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Request> Function(Request request);
/// A function that should convert the body of a [Response] from the HTTP
/// representation to a Dart object.
typedef ConvertResponse<T> = FutureOr<Response> Function(Response response);

/// A helper class for wrapping a request and a response converter.
/// See [ConvertRequest], [ConvertResponse].
@immutable
class FactoryConverter {
final ConvertRequest request;
Expand All @@ -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
Expand Down

0 comments on commit d556993

Please sign in to comment.