Releases: swisnl/json-api-client
Releases · swisnl/json-api-client
0.15.0
This release includes changes to some interfaces #47. This is a breaking change if you use these interfaces in your own code.
Added
- Added
takemethod toRepositoryto allow fetching resources without id. - Added links and meta to
ItemInterface. - Added
Jsonapiclass. - Added links and meta to
OneRelationInterfaceandManyRelationInterface. - Added
LinkandLinksclasses. - Added links to
Error.
Changed
Error::getMeta()now returns aMetainstance instead of anErrorMetainstance. TheMetaclass does not have thehasandgetmethods, but uses magic overloading methods (e.g.__getand__set) just likeItem.
N.B. This is a breaking change if you use meta on errors.DocumentInterface::getLinks()now returns aLinksinstance instead of a plain array. If no links are present, it returnsnull. All implementations have been updated to reflect these changes.
N.B. This is a minor breaking change if you use links on documents.DocumentInterface::getMeta()now returns aMetainstance instead of a plain array. If no meta is present, it returnsnull. All implementations have been updated to reflect these changes.
N.B. This is a minor breaking change if you use meta on documents.DocumentInterface::getJsonapi()now returns aJsonapiinstance instead of a plain array. If no jsonapi is present, it returnsnull. All implementations have been updated to reflect these changes.- Parameters for
ItemInterface::setRelation()have changed to include optionalLinksandMetaobjects. JsonApi\ErrorsParser,JsonApi\HydratorandJsonApi\Parserhave an extra dependency in their constructor.
N.B. Make sure to add this dependency if you've overwrittenServiceProvider::registerParseror construct theJsonApi\Parseryourself.
Removed
- Removed
ErrorMetaclass in favor of genericMetaclass.
Fixed
- Fixed parsing of JSON:API object in document.
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
OneRelationInterfaceandManyRelationInterfaceto differentiate between singular and plural relations. - Added documentation about
ItemDocumentBuilder,ItemHydratorandRepositoryclasses.
Changed
- Moved
setTypeandgetTypefromRelationInterfaceto a separate interface;TypedRelationInterface. - Added type hints to
ItemInterface::setRelation. - Added return type hint to
Item::hasAttribute.
Removed
- Removed
RelationInterfacein favor ofOneRelationInterfaceandManyRelationInterface. - Removed
setIdandgetIdfromHasOneRelationandMorphToRelation. These operations should be performed on the included item. - Removed
setTypeandgetTypefrom 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 theItemInterfaceyourself 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. Repositorydoesn't throw exceptions anymore. #41
N.B. This is a breaking change if you catchDocumentNotFoundExceptionorDocumentTypeException. If you would like the old behaviour, you can simply extend theRepositoryand implement it yourself.- A HasOne or MorphTo relation do not set a
[relationship]_idfield on the parent when associating a related item. #42
Removed
- Removed obsolete
ItemDocumentSerializerin favor ofJsonSerializable.
N.B. This is a breaking change if you use this class directly, construct theDocumentClientyourself or have overwritten\Swis\JsonApi\Client\Providers\ServiceProvider::registerClients. TheItemDocumentcan now be serialized usingjson_encode. - Removed obsolete
DocumentNotFoundExceptionandDocumentTypeException. #41
N.B. This is a breaking change if you catch these exceptions.