From 56d9145f531e5fa8f23aa8d5851f8ce0ef77c374 Mon Sep 17 00:00:00 2001 From: f3ath Date: Wed, 1 Jan 2020 14:10:23 -0800 Subject: [PATCH 1/2] Fix #74 --- CHANGELOG.md | 7 ++++++- example/fetch_collection.dart | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f05941f..9e6004d 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). +## [3.2.1] - 2020-01-01 +### Fixed +- issue [#74](https://github.com/f3ath/json-api-dart/issues/74) + ## [3.2.0] - 2019-12-30 ### Added - `matchBase` option to `PathBasedUrlDesign`. @@ -138,7 +142,8 @@ Most of the changes are **BC-BREAKING**. ### Added - Client: fetch resources, collections, related resources and relationships -[Unreleased]: https://github.com/f3ath/json-api-dart/compare/3.2.0...HEAD +[Unreleased]: https://github.com/f3ath/json-api-dart/compare/3.2.1...HEAD +[3.2.0]: https://github.com/f3ath/json-api-dart/compare/3.2.0...3.2.1 [3.2.0]: https://github.com/f3ath/json-api-dart/compare/3.1.0...3.2.0 [3.1.0]: https://github.com/f3ath/json-api-dart/compare/3.0.0...3.1.0 [3.0.0]: https://github.com/f3ath/json-api-dart/compare/2.1.0...3.0.0 diff --git a/example/fetch_collection.dart b/example/fetch_collection.dart index 5983488..48c6838 100644 --- a/example/fetch_collection.dart +++ b/example/fetch_collection.dart @@ -1,11 +1,11 @@ import 'package:http/http.dart'; import 'package:json_api/client.dart'; -/// Start the `cars_server.dart` first! +/// Start `dart example/cars_server.dart` first void main() async { final httpClient = Client(); final jsonApiClient = JsonApiClient(httpClient); - final url = Uri.parse('http://localhost:8080/companies/2'); + final url = Uri.parse('http://localhost:8080/companies'); final response = await jsonApiClient.fetchCollection(url); httpClient.close(); // Don't forget to close the http client print('The collection page size is ${response.data.collection.length}'); diff --git a/pubspec.yaml b/pubspec.yaml index 8b61d6e..d097701 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: json_api -version: 3.2.0 +version: 3.2.1 homepage: https://github.com/f3ath/json-api-dart description: JSON:API Client for Flutter, Web and VM. Supports JSON:API v1.0 (http://jsonapi.org) environment: From 24919e795f8f04b76fb6e62b6f180ca59a0b1cde Mon Sep 17 00:00:00 2001 From: f3ath Date: Wed, 1 Jan 2020 14:13:59 -0800 Subject: [PATCH 2/2] Code blocks must be identical --- lib/src/client/json_api_client.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/client/json_api_client.dart b/lib/src/client/json_api_client.dart index 597f740..8cbf9da 100644 --- a/lib/src/client/json_api_client.dart +++ b/lib/src/client/json_api_client.dart @@ -15,10 +15,11 @@ import 'package:json_api/src/client/status_code.dart'; /// import 'package:http/http.dart'; /// import 'package:json_api/client.dart'; /// +/// /// Start `dart example/cars_server.dart` first! /// void main() async { /// final httpClient = Client(); /// final jsonApiClient = JsonApiClient(httpClient); -/// final url = Uri.parse('http://localhost:8080/companies/2'); +/// final url = Uri.parse('http://localhost:8080/companies'); /// final response = await jsonApiClient.fetchCollection(url); /// httpClient.close(); // Don't forget to close the http client /// print('The collection page size is ${response.data.collection.length}');