Releases: mattpolzin/JSONAPI
Mostly finished JSONAPITesting comparison API and improved errors
APIs should not change much during beta, just improving test coverage and fixing bugs.
Added much more descriptive error handling
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.
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
3.0.0-alpha.2 abstract away document comparison
1st alpha release of 3.0.0
This release will:
- Add
compare(to:)
API toJSONAPITesting
framework to produce much easier to read diagnostics when twoResourceObjects
orDocuments
that are expected to be the same actually have differences. - Bring breaking changes around type names and APIs in the interest of usability.
- 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()`
Fixed:
- In 2.5.0,
Document.SuccessDocument.including()
returned aDocument
. That has been fixed in 2.5.1 to return aDocument.SuccessDocument
.
Add Document.ErrorDocument and Document.SuccessDocument
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
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
Add a type that can represent one of 11 different possible included types.
Additional error types!
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.