Skip to content

Releases: swisnl/json-api-client

0.14.0

23 Jan 15:45
Compare
Choose a tag to compare

This release includes changes to some interfaces #45. This is a breaking change if you use these interfaces in your own code.

Added

  • Added OneRelationInterface and ManyRelationInterface to differentiate between singular and plural relations.
  • Added documentation about ItemDocumentBuilder, ItemHydrator and Repository classes.

Changed

  • Moved setType and getType from RelationInterface to a separate interface; TypedRelationInterface.
  • Added type hints to ItemInterface::setRelation.
  • Added return type hint to Item::hasAttribute.

Removed

  • Removed RelationInterface in favor of OneRelationInterface and ManyRelationInterface.
  • Removed setId and getId from HasOneRelation and MorphToRelation. These operations should be performed on the included item.
  • Removed setType and getType from morph relations. Use regular relations if you want to set the type.

0.13.0

14 Jan 15:38
Compare
Choose a tag to compare

Fixed

  • Omit item from included when it has no attributes or relationships (only type and id)
    N.B. This is a breaking change if you implement the ItemInterface yourself instead of using the supplied Item.
  • Make sure included is always a plain array so it is serialized as array

0.12.1

11 Jan 16:21
Compare
Choose a tag to compare

Fixed

  • Fix hydrating of HasOne relations by id using ItemHydrator #44

0.12.0

11 Jan 12:30
Compare
Choose a tag to compare

Added

Changed

  • Add headers to request methods in DocumentClientInterface. #34
    N.B. This is a breaking change if you implement the interface yourself or extend the DocumentClient.
  • Repository doesn't throw exceptions anymore. #41
    N.B. This is a breaking change if you catch DocumentNotFoundException or DocumentTypeException. If you would like the old behaviour, you can simply extend the Repository and implement it yourself.
  • A HasOne or MorphTo relation do not set a [relationship]_id field on the parent when associating a related item. #42

Removed

  • Removed obsolete ItemDocumentSerializer in favor of JsonSerializable.
    N.B. This is a breaking change if you use this class directly, construct the DocumentClient yourself or have overwritten \Swis\JsonApi\Client\Providers\ServiceProvider::registerClients. The ItemDocument can now be serialized using json_encode.
  • Removed obsolete DocumentNotFoundException and DocumentTypeException. #41
    N.B. This is a breaking change if you catch these exceptions.

Fixed

  • Do not fail on, but skip relationships without data #38
  • Dissociating a related item now produces valid JSON #42

0.11.0

21 Dec 11:26
Compare
Choose a tag to compare

Changed

  • Implement JsonSerializable in Document #32
  • Add toArray to DocumentInterface and Document so CollectionDocument and ItemDocument now share the same toArray method #32
    N.B. This will be breaking if you implement the DocumentInterface yourself.

0.10.3

26 Oct 09:28
Compare
Choose a tag to compare

Fixed

  • Omit 'type' attribute when filling attributes for a morph relationship #28

0.10.2

24 Oct 10:58
Compare
Choose a tag to compare

Fixed

  • Allow '0' as id in ItemDocumentBuilder #27

0.10.1

25 Sep 13:17
Compare
Choose a tag to compare

Fixed

  • Add the id when the item has one and not only when it is not new

0.10.0

10 Sep 07:29
Compare
Choose a tag to compare

Added

  • Added Laravel 5.7 support #26

0.9.0

30 Aug 12:05
Compare
Choose a tag to compare

Added

  • Added Laravel 5.6 support #25
  • Travis now runs tests on all supported versions of Laravel #25