Skip to content

Release 4.3.0 #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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).

## [Unreleased]
## [4.3.0] - 2020-07-30
### Added
- `meta` parameter for createResourceAt()

### Removed
- Dropped support for Dart 2.6

Expand Down Expand Up @@ -106,14 +110,14 @@ is missing. Before in such cases a `FormatException` would be thrown ([pr](https
## [2.0.0] - 2019-07-12
### Changed
- This package now consolidates the Client, the Server and the Document in one single library.
It does not depend on `json_api_document` and `json_api_server` anymore, please remove these packages
from your `pubspec.yaml`.
It does not depend on `json_api_document` and `json_api_server` anymore, please remove these packages
from your `pubspec.yaml`.
- The min Dart SDK version bumped to `2.3.0`
- The Client requires an instance of HttpClient to be passed to the constructor explicitly.
- Both the Document and the Server have been refactored with lots of **BREAKING CHANGES**.
See the examples and the functional tests for details.
See the examples and the functional tests for details.
- Meta properties are not defensively copied, but set directly. Meta property behavior is unified across
the Document model.
the Document model.

### Removed
- `JsonApiParser` is removed. Use the static `decodeJson` methods in the corresponding classes instead.
Expand Down Expand Up @@ -172,7 +176,8 @@ is missing. Before in such cases a `FormatException` would be thrown ([pr](https
### Added
- Client: fetch resources, collections, related resources and relationships

[Unreleased]: https://github.com/f3ath/json-api-dart/compare/4.2.2...HEAD
[Unreleased]: https://github.com/f3ath/json-api-dart/compare/4.3.0...HEAD
[4.3.0]: https://github.com/f3ath/json-api-dart/compare/4.2.2...4.3.0
[4.2.2]: https://github.com/f3ath/json-api-dart/compare/4.2.1...4.2.2
[4.2.1]: https://github.com/f3ath/json-api-dart/compare/4.2.0...4.2.1
[4.2.0]: https://github.com/f3ath/json-api-dart/compare/4.1.0...4.2.0
Expand Down
6 changes: 4 additions & 2 deletions lib/src/client/json_api_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class JsonApiClient {
/// https://jsonapi.org/format/#crud-creating
Future<Response<ResourceData>> createResourceAt(Uri uri, Resource resource,
{Map<String, String> headers, Map<String, Object> meta}) =>
_call(_post(uri, headers, _resourceDoc(resource, meta: meta)), ResourceData.fromJson);
_call(_post(uri, headers, _resourceDoc(resource, meta: meta)),
ResourceData.fromJson);

/// Deletes the resource.
///
Expand Down Expand Up @@ -127,7 +128,8 @@ class JsonApiClient {

final _api = Api(version: '1.0');

Document<ResourceData> _resourceDoc(Resource resource, {Map<String, Object> meta}) =>
Document<ResourceData> _resourceDoc(Resource resource,
{Map<String, Object> meta}) =>
Document(ResourceData.fromResource(resource), meta: meta, api: _api);

Document<ToMany> _toManyDoc(Iterable<Identifier> identifiers) =>
Expand Down
21 changes: 12 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: json_api
version: 4.2.2
homepage: https://github.com/f3ath/json-api-dart
description: Framework-agnostic implementations of JSON:API Client (Flutter, Web and VM) and Server (VM). Supports JSON:API v1.0 (http://jsonapi.org)
environment:
sdk: '>=2.7.0 <3.0.0'
version: 4.3.0
description: "Framework-agnostic implementations of JSON:API Client (Flutter, Web and VM) and Server (VM). Supports JSON:API v1.0 (http://jsonapi.org)"
homepage: "https://github.com/f3ath/json-api-dart"

dependencies:
http: ^0.12.0
http_parser: ^3.1.4

dev_dependencies:
args: ^1.5.2
pedantic: ^1.9.0
test: ^1.9.2
json_matcher: ^0.2.3
pedantic: ^1.9.0
shelf: ^0.7.5
stream_channel: ^2.0.0
uuid: ^2.0.1
test: ^1.9.2
test_coverage: ^0.4.0
shelf: ^0.7.5
uuid: ^2.0.1

environment:
sdk: ">=2.7.0 <3.0.0"
4 changes: 2 additions & 2 deletions test/functional/crud/creating_resources_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() async {
final base = Uri(scheme: 'http', host: host, port: port);
final routing = StandardRouting(base);

group('Server-genrated ID', () {
group('Server-generated ID', () {
test('201 Created', () async {
final repository = InMemoryRepository({
'people': {},
Expand Down Expand Up @@ -53,7 +53,7 @@ void main() async {
});
});

group('Client-genrated ID', () {
group('Client-generated ID', () {
JsonApiClient client;
RoutingClient routingClient;
setUp(() async {
Expand Down