Skip to content

Releases: mattpolzin/JSONAPI

Mostly finished JSONAPITesting comparison API and improved errors

13 Nov 02:43
440b649
Compare
Choose a tag to compare

APIs should not change much during beta, just improving test coverage and fixing bugs.

Added much more descriptive error handling

11 Nov 07:48
8c3a82e
Compare
Choose a tag to compare

Added much more descriptive error handling for decoding of Resource Objects and JSON:API Documents.

DecodingError and JSONAPICodingError replaced by ResourceObjectDecodingError and DocumentDecodingError where appropriate in order to get more concise JSON:API-targeted error reporting. Any error handling that specifically targets DecodingError coming out of the JSONAPI framework will need to be revisited.

Reduce `Document` `compare(to:)` footprint.

07 Nov 07:50
19636a4
Compare
Choose a tag to compare

Add associated type for the primary resource on the primary resource body protocols.

Drastically reduce the footprint of document compare(to:) functions by using the new associated type.

Abstract away the types for document comparison

06 Nov 08:25
Compare
Choose a tag to compare
3.0.0-alpha.2

abstract away document comparison

1st alpha release of 3.0.0

06 Nov 07:14
9f42e5f
Compare
Choose a tag to compare
Pre-release

This release will:

  1. Add compare(to:) API to JSONAPITesting framework to produce much easier to read diagnostics when two ResourceObjects or Documents that are expected to be the same actually have differences.
  2. Bring breaking changes around type names and APIs in the interest of usability.
  3. Deprecate ResourceObject subscript access to attributes in favor of key path dynamic member lookup.

Test coverage and documentation will be improved over the alpha releases in addition to bugs being fixed and additional (potentially breaking) changes being introduced.

Fix return type of `Document.SuccessDocument.including()`

27 Oct 23:32
Compare
Choose a tag to compare

Fixed:

  • In 2.5.0, Document.SuccessDocument.including() returned a Document. That has been fixed in 2.5.1 to return a Document.SuccessDocument.

Add Document.ErrorDocument and Document.SuccessDocument

21 Oct 05:30
Compare
Choose a tag to compare

Add two new types that guarantee either success or failure for a Document body. These types can be used in situations where you want to let the type system know a Document will have a data or error body prior to the Document being initialized.

Adding tapping/replacing on attributes and relationships

13 Oct 02:33
Compare
Choose a tag to compare

Adds tappingAttributes(), replacingAttributes(), tappingRelationships(), and replacingRelationships() to ResourceObject.

Each method returns a new ResourceObject with replaced or mutated Attributes or Relationships.

See https://github.com/mattpolzin/JSONAPI#replacing-and-tapping-attributesrelationships for more details.

Add Include11 Type

03 Oct 03:11
44f9bca
Compare
Choose a tag to compare

Add a type that can represent one of 11 different possible included types.

Additional error types!

30 Sep 00:11
194a58a
Compare
Choose a tag to compare

The GenericJSONAPIError makes it easy to fit any old structure to the requirements for the JSONAPIError protocol.

The BasicJSONAPIError provides out-of-box support for parsing most of the fields the JSON:API Spec says might be available on error objects. These fields are all optional because the Spec does not require any of them to be present.

More than likely, transitioning from use of UnknownJSONAPIError to BasicJSONAPIError<String> (or perhaps specialized on Int) is an easy non-breaking move for most codebases that gets you more information about the errors being parsed.