Releases: swisnl/json-api-client
Releases · swisnl/json-api-client
0.14.0
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
andManyRelationInterface
to differentiate between singular and plural relations. - Added documentation about
ItemDocumentBuilder
,ItemHydrator
andRepository
classes.
Changed
- Moved
setType
andgetType
fromRelationInterface
to a separate interface;TypedRelationInterface
. - Added type hints to
ItemInterface::setRelation
. - Added return type hint to
Item::hasAttribute
.
Removed
- Removed
RelationInterface
in favor ofOneRelationInterface
andManyRelationInterface
. - Removed
setId
andgetId
fromHasOneRelation
andMorphToRelation
. These operations should be performed on the included item. - Removed
setType
andgetType
from morph relations. Use regular relations if you want to set the type.
0.13.0
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 theItemInterface
yourself instead of using the suppliedItem
. - Make sure included is always a plain array so it is serialized as array
0.12.1
0.12.0
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 theDocumentClient
. Repository
doesn't throw exceptions anymore. #41
N.B. This is a breaking change if you catchDocumentNotFoundException
orDocumentTypeException
. If you would like the old behaviour, you can simply extend theRepository
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 ofJsonSerializable
.
N.B. This is a breaking change if you use this class directly, construct theDocumentClient
yourself or have overwritten\Swis\JsonApi\Client\Providers\ServiceProvider::registerClients
. TheItemDocument
can now be serialized usingjson_encode
. - Removed obsolete
DocumentNotFoundException
andDocumentTypeException
. #41
N.B. This is a breaking change if you catch these exceptions.