Skip to content

New testing feature and _much_ better errors

Choose a tag to compare

@mattpolzin mattpolzin released this 16 Nov 07:59
  • Adds JSONAPITesting framework compare(to:) functions that deliver concise comparisons of two documents or resource objects. Just print the String(describing:) a comparison to get a human readable description of the differences.
  • Adds ResourceObjectDecodingError and DocumentDecodingError which represent more JSON:API-specific errors and come with good string descriptions for many common reasons why JSON:API resources or documents could fail to decode. Just catch the error from decoding a ResourceObject or Document and save or print String(describing: error).

⚠️ Breaking Changes ⚠️

📛 Renames JSONAPIDocument to CodableJSONAPIDocument.
📛 Renames OptionalPrimaryResource to OptionalCodablePrimaryResource.
📛 Renames PrimaryResource to CodablePrimaryResource.
📛 Renames ResourceBody to CodableResourceBody.
📛 Renames PolyWrapped to CodablePolyWrapped.
📛 Renames SingleResourceBody.Entity to SingleResourceBody.PrimaryResource
📛 Renames ManyResourceBody.Entity to ManyResourceBody.PrimaryResource
📛 Renames JSONAPIEncodingError to JSONAPICodingError

⛔️ Deprecates subscript access of ResourceObject attributes in favor of key path dynamic member lookup.

🗑 Removes key path dynamic member lookup of Document properties on Document.SuccessDocument and Document.ErrorDocument in favor of directly providing relevant accessors (see SuccessDocument/ErrorDocument for details).