From f4e3cb795200d7035cb64e39cc39c0ae1acb1145 Mon Sep 17 00:00:00 2001 From: f3ath Date: Wed, 12 May 2021 18:45:22 -0700 Subject: [PATCH 1/2] Fix for #116 --- CHANGELOG.md | 5 +++++ lib/src/client/persistent_handler.dart | 3 ++- pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f914e9..48a765a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.0.2] - 2021-05-12 +### Fixed +- PersistentHandler to implement HttpHandler + ## [5.0.1] - 2021-05-11 ### Fixed - Missing http client exports @@ -192,6 +196,7 @@ the Document model. ### Added - Client: fetch resources, collections, related resources and relationships +[5.0.2]: https://github.com/f3ath/json-api-dart/compare/5.0.1...5.0.2 [5.0.1]: https://github.com/f3ath/json-api-dart/compare/5.0.0...5.0.1 [5.0.0]: https://github.com/f3ath/json-api-dart/compare/3.2.3...5.0.0 [3.2.3]: https://github.com/f3ath/json-api-dart/compare/3.2.2...3.2.3 diff --git a/lib/src/client/persistent_handler.dart b/lib/src/client/persistent_handler.dart index 6974a8b..ef96181 100644 --- a/lib/src/client/persistent_handler.dart +++ b/lib/src/client/persistent_handler.dart @@ -7,7 +7,7 @@ import 'package:json_api/http.dart'; /// Handler which relies on the built-in Dart HTTP client. /// It is the developer's responsibility to instantiate the client and /// call `close()` on it in the end pf the application lifecycle. -class PersistentHandler { +class PersistentHandler implements HttpHandler{ /// Creates a new instance of the handler. Do not forget to call `close()` on /// the [client] when it's not longer needed. PersistentHandler(this.client, {this.defaultEncoding = utf8}); @@ -15,6 +15,7 @@ class PersistentHandler { final Client client; final Encoding defaultEncoding; + @override Future handle(HttpRequest request) async { final response = await Response.fromStream( await client.send(Request(request.method, request.uri) diff --git a/pubspec.yaml b/pubspec.yaml index f4f6410..9e22394 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: json_api -version: 5.0.1 +version: 5.0.2 homepage: https://github.com/f3ath/json-api-dart description: A framework-agnostic implementations of JSON:API Client and Server. Supports JSON:API v1.0 (https://jsonapi.org) environment: From d8bdd5f5699b01cedf4a8cc767e0f299ba9e87ba Mon Sep 17 00:00:00 2001 From: f3ath Date: Wed, 12 May 2021 18:46:43 -0700 Subject: [PATCH 2/2] Format --- lib/src/client/persistent_handler.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/client/persistent_handler.dart b/lib/src/client/persistent_handler.dart index ef96181..117b900 100644 --- a/lib/src/client/persistent_handler.dart +++ b/lib/src/client/persistent_handler.dart @@ -7,7 +7,7 @@ import 'package:json_api/http.dart'; /// Handler which relies on the built-in Dart HTTP client. /// It is the developer's responsibility to instantiate the client and /// call `close()` on it in the end pf the application lifecycle. -class PersistentHandler implements HttpHandler{ +class PersistentHandler implements HttpHandler { /// Creates a new instance of the handler. Do not forget to call `close()` on /// the [client] when it's not longer needed. PersistentHandler(this.client, {this.defaultEncoding = utf8});