diff --git a/CHANGELOG.md b/CHANGELOG.md index d776f78..34edc0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.3 + +* Fix "Document Validation" API - returning nullable type + ## 0.4.2 * Update API client - Document Validation diff --git a/lib/src/autogram_service.dart b/lib/src/autogram_service.dart index 4f635ee..8e62f6b 100644 --- a/lib/src/autogram_service.dart +++ b/lib/src/autogram_service.dart @@ -61,7 +61,7 @@ class AutogramService implements IAutogramService { } @override - Future getDocumentValidation( + Future getDocumentValidation( String documentId, ) { return _autogram.documentsGuidValidateGet(guid: documentId).then(unwrap); diff --git a/lib/src/iautogram_service.dart b/lib/src/iautogram_service.dart index eafd14e..fd77b9c 100644 --- a/lib/src/iautogram_service.dart +++ b/lib/src/iautogram_service.dart @@ -32,8 +32,8 @@ abstract class IAutogramService { /// Requests a signature validation report of the document. /// - /// See - Future getDocumentValidation( + /// See + Future getDocumentValidation( String documentId, ); diff --git a/pubspec.yaml b/pubspec.yaml index 749f9ff..676a332 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: autogram_sign description: "Autogram service REST API client" -version: 0.4.2 +version: 0.4.3 homepage: "" environment: diff --git a/test/unwap_test.dart b/test/unwap_test.dart index b8a4f94..9dfb196 100644 --- a/test/unwap_test.dart +++ b/test/unwap_test.dart @@ -15,6 +15,14 @@ void main() { expect(actual, "Test"); }); + test('unwrap returns nullable value for 200 status code', () { + final httpResponse = http.Response('"Test"', 200); + final response = chopper.Response(httpResponse, "Test"); + final actual = unwrap(response); + + expect(actual, "Test"); + }); + test('unwrap returns nothing for 204 status code with no body', () { final httpResponse = http.Response('', 204); final response = chopper.Response(httpResponse, null);