Version 4.0.0 Stable Release
Additions & Fixes
Release 4.0.0 has changed in the following ways since version 3.x. The following list includes changes for all 4.0.0 alpha and release candidates. There are no functional changes between the latest release candidate and this stable release.
➕ ResourceObject
is now Hashable
when it is not Unidentified
.
➕ ResourceObject
now conforms to Swift.Identifiable
when it is not Unidentified
.
➕ CompoundResource
and new Document
initializers make document creation more ergonomic.
➕ Modify Document.SuccessDocument
to guarantee non-optional properties where appropriate.
➕ SucceedableJSONAPIDocument
and FailableJSONAPIDocument
improve generic abstraction story.
➕ MetaRelationship
added for relationships with only links and metadata.
🐞 Fix/Improve errors during decoding caused by malformed ResourceObject relationships.
Breaking Changes
📛 Renames Identifiable
to JSONAPIIdentifiable
to avoid confusion and conflict with Swift.Identifiable
.
📛 Renames JSONAPIIdentifiable
's Identifier
associated type to ID
to match that of the Swift Identifiable
type.
🗑 Remove deprecated subscript access to ResourceObject attributes.
Suggested approach to migrating code:
- Find
JSONAPI.Identifiable
orIdentifiable
(careful not to pick up any uses of SwiftIdentifiable
in your codebase) and replace withJSONAPIIdentifiable
. - Anywhere you are using
Identifier()
in the context of aResourceObject
to construct its ID, replace withID()
. - Anywhere you are using subscript access on
ResourceObject
to access an attribute, switch to using dynamic member access (i.e.widget[\.cog]
changes to widget.cog`).