Skip to content

Releases: woohoolabs/yang

2.0.0-beta1

04 Dec 22:24
2.0.0-beta1
efd7804
Compare
Choose a tag to compare
2.0.0-beta1 Pre-release
Pre-release

ADDED:

  • JSON:API 1.1 related features:
    • Support for Profiles
    • Support for type links in errors
  • Document::errorCount() to easily count errors in the document
  • Support for defining default value when using the ResourceObject::attribute() method

CHANGED:

  • Improve type-safety by eliminating null return values (BREAKING):
    • JsonApiResponse::document() throws an exception instead of returning null if the response doesn't contain a document
    • Document::primaryResources() throws an exception if the document is a single-resource or error document
    • Document::primaryResource() throws an exception if the document is a collection or error document or the primary resource is missing
    • Document::resource() throws an exception instead of returning null if the requested resource is missing
    • Document::error() throws an exception instead of returning null if the document does not contain the requested error
    • Relationship::resources() throws an exception instead of returning an empty array if the relationship is a to-one
    • Relationship::resource() throws an exception instead of returning null if the relationship is a to-many or empty
    • Relationship::resourceBy() throws an exception instead of returning null if the requested resource is missing
    • ResourceObject::relationship() throws an exception instead of returning null if the requested relationship is missing
  • Move errors, links, and resources to their own namespace (BREAKING):
    • WoohooLabs\Yang\JsonApi\Schema\Error to WoohooLabs\Yang\JsonApi\Schema\Error\Error
    • WoohooLabs\Yang\JsonApi\Schema\ErrorSource to WoohooLabs\Yang\JsonApi\Schema\Error\ErrorSource
    • WoohooLabs\Yang\JsonApi\Schema\Link to WoohooLabs\Yang\JsonApi\Schema\Link\Link
    • WoohooLabs\Yang\JsonApi\Schema\ResourceObjects to WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObjects
    • WoohooLabs\Yang\JsonApi\Schema\ResourceObject to WoohooLabs\Yang\JsonApi\Schema\Resource\ResourceObject
  • Return separate classes instead of Links for the different types of links (BREAKING):
    • DocumentLinks when using Document::links()
    • ResourceLinks when using ResourceObject::links()
    • RelationshipLinks when using Relationship::links()
    • ErrorLinks when using Error::links()
  • JsonSerializer::serialize() will throw a RequestException instead of LogicException if the body is of invalid type (BREAKING)
  • Rename JsonApi to JsonApiObject (BREAKING)

REMOVED:

  • The generic Link class (BREAKING)

FIXED:

  • Issues with 0 when converting to array

1.5.0

15 Nov 15:16
1.5.0
afc2b71
Compare
Choose a tag to compare

ADDED:

  • Support for PSR-18 and HTTPlug 2.0

CHANGED:

  • Update PHPUnit to 7.0

1.4.1

24 Dec 09:28
1.4.1
e2af383
Compare
Choose a tag to compare

ADDED:

  • ClassHydrator::hydrateObject() method

1.4.0

11 Dec 23:38
1.4.0
b229c9d
Compare
Choose a tag to compare

ADDED:

  • Support for hydrating collections via HydratorInterface::hydrateCollection()

1.3.2

06 Dec 22:10
1.3.2
312955c
Compare
Choose a tag to compare

FIXED:

  • #9: Resources with an ID of "0" disappear when using ClassHydrator
  • Other issues with "0" affecting ResourceObject::toString() and JsonApiRequestBuilder::toString()

1.3.1

23 Nov 09:46
1.3.1
74673ef
Compare
Choose a tag to compare

FIXED:

  • #8: Fix for unexpected behaviour when To-One relationship data is null

1.2.1

23 Nov 09:46
1.2.1
327bb45
Compare
Choose a tag to compare

FIXED:

  • #8: Fix for unexpected behaviour when To-One relationship data is null

1.3.0

17 Oct 18:29
1.3.0
6b3f116
Compare
Choose a tag to compare

CHANGED:

  • Increased minimum PHP version requirement to 7.1

1.2.0

10 Oct 20:48
1.2.0
2b24ac8
Compare
Choose a tag to compare

ADDED:

  • Ability to hydrate responses to objects via ClassHydrator
  • Ability to retrieve all relationships of a resource via ResourceObject::getRelationships()

1.1.0

01 Sep 10:23
1.1.0
7082186
Compare
Choose a tag to compare

ADDED:

  • #4: Allow relationship's resource identifier objects to have a "meta" value

CHANGED:

  • ToManyRelationship::addResourceIdentifier() uses fluent interface
  • Added missing parameter type declarations