Skip to content

Version 4.0.0 Stable Release

Compare
Choose a tag to compare
@mattpolzin mattpolzin released this 31 May 23:04
51cb140

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

⚠️ Bump minimum Swift version to 5.2
📛 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 or Identifiable (careful not to pick up any uses of Swift Identifiable in your codebase) and replace with JSONAPIIdentifiable.
  • Anywhere you are using Identifier() in the context of a ResourceObject to construct its ID, replace with ID().
  • 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`).