Releases: woohoolabs/yin
Releases · woohoolabs/yin
4.3.0
4.2.1
4.2.0
4.1.2
ADDED:
- Support for PHP 8
- Support for PHPUnit 9
CHANGED:
- Instead of zendframework packages, laminas are required
4.1.1
4.1.0
4.0.1
4.0.0
This release is the same as 4.0.0-beta2. The full change set is the following:
ADDED:
- JSON:API 1.1 related features:
- Partial support for Profiles
- Support for
typelinks in errors
Resourcescan also use the$objectproperty to access the object which is being transformed- Separate classes for the different types of links instead of the generic
LinksclassDocumentLinksResourceLinksRelationshipLinksErrorLinks
- New capabilities related to pagination:
- #70: Better support for query parameters in pagination links
PaginationFactoryclass to decouple Pagination class instantiation from the requestJsonApi::getPaginationFactory()method to make it easier to retrieve the Pagination FactoryFixedCursorBasedPaginationclass which preserves the original behaviour of the changedCursorBasedPaginationFixedCursorBasedPaginationProviderTraitfor using it in connection withFixedCursorBasedPaginationFixedPageBasedPaginationLinkProviderTraitfor using it in connection withFixedPageBasedPagination
- New capabilities related to relationships:
ResponseInterface::hasToOneRelationship()to determine if a specific To-One relationship existsResponseInterface::hasToManyRelationship()to determine if a specific To-Many relationship exists
CHANGED:
- Updated
justinrainbow/json-schemato v5.2 Documentsshould use the$objectproperty instead of$domainObject(BREAKING CHANGE)- Links are used strictly according to the spec (BREAKING CHANGE):
AbstractSuccessfulDocument::getLinks()returns?DocumentLinksinstead of?LinksAbstractErrorDocument::getLinks()returns?DocumentLinksinstead of?LinksErrorDocument::getLinks()returns?DocumentLinksinstead of?LinksErrorDocument::setLinks()expects a parameter of?DocumentLinkstype instead of?LinksAbstractResource::getLinks()returns?ResourceLinksinstead ofLinksAbstractRelationship::getLinks()returns?RelationshipLinksinstead ofLinksAbstractRelationship::setLinks()expects a parameter of?RelationshipLinkstype instead ofLinksError::getLinks()returnsErrorLinksinstead ofLinksError::setLinks()expects a parameter ofErrorLinksinstead ofLinks
- Improvements related to
JsonApiExceptionInterface(BREAKING CHANGE):JsonApiExceptionInterfacenow extendsThrowableJsonApiExceptionInterface::getErrorDocument()must return anErrorDocumentInterfaceinstead of anAbstractErrorDocument
- Improvements related to pagination (BREAKING CHANGE):
- A
$defaultSizeconstructor parameter was added toCursorBasedPaginationto define a default value for thepage[size]query parameter - Properties and methods of
FixedPageBasedPaginationbecame non-nullable - Properties and methods of
OffsetBasedPaginationbecame non-nullable - Properties and methods of
PageBasedPaginationbecame non-nullable - Methods of
PaginationLinkProviderInterfaceexpect a second parameter with a$queryStringname
- A
- Setting the status code and
Content-Typeheader of the JSON:API response is done by theResponderby default instead ofSerializers (BREAKING CHANGE):- The
Responderclass sets the status code and theContent-Typeheader of the response, while customSerializers can override them optionally SerializerInterface::serialize()only accepts two arguments instead of 3 as the$responseCodeparameter was removedJsonSerializerdoes not set theContent-Typeheader and the status code of the response anymore
- The
- Improvements related to relationships (BREAKING CHANGE):
ResponseInterface::getToOneRelationship()throws an exception instead of returning null if the relationship doesn't existResponseInterface::getToManyRelationship()throws an exception instead of returning null if the relationship doesn't exist
- The
TransformerTrait::fromSqlToIso8601Time()method expects a?DateTimeZoneas its second argument instead ofstring(BREAKING CHANGE)
REMOVED:
- The generic
Linksclass (BREAKING CHANGE) - Methods related to pagination class instantiation were removed from
RequestInterface(BREAKING CHANGE):RequestInterface::getFixedPageBasedPagination()RequestInterface::getPageBasedPagination()RequestInterface::getOffsetBasedPagination()RequestInterface::getCursorBasedPagination()
- Various deprecated classes (BREAKING CHANGE):
WoohooLabs\Yin\JsonApi\Document\AbstractCollectionDocument: useWoohooLabs\Yin\JsonApi\Schema\Document\AbstractCollectionDocumentinsteadWoohooLabs\Yin\JsonApi\Document\AbstractDocument: useWoohooLabs\Yin\JsonApi\Schema\Document\AbstractDocumentinsteadWoohooLabs\Yin\JsonApi\Document\AbstractErrorDocument: useWoohooLabs\Yin\JsonApi\Schema\Document\AbstractErrorDocumentinsteadWoohooLabs\Yin\JsonApi\Document\AbstractSimpleResourceDocument: useWoohooLabs\Yin\JsonApi\Schema\Document\AbstractSimpleResourceDocumentinsteadWoohooLabs\Yin\JsonApi\Document\AbstractSingleResourceDocument: useWoohooLabs\Yin\JsonApi\Schema\Document\AbstractSingleResourceDocumentinsteadWoohooLabs\Yin\JsonApi\Document\AbstractSuccessfulResourceDocument: useWoohooLabs\Yin\JsonApi\Schema\Document\AbstractSuccessfulResourceDocumentinsteadWoohooLabs\Yin\JsonApi\Document\ErrorDocument: useWoohooLabs\Yin\JsonApi\Schema\Document\ErrorDocumentinsteadWoohooLabs\Yin\JsonApi\Transformer\AbstractResourceTransformer: useWoohooLabs\Yin\JsonApi\Schema\Resource\AbstractResourceinsteadWoohooLabs\Yin\JsonApi\Transformer\ResourceTransformerInterface: useWoohooLabs\Yin\JsonApi\Schema\Resource\ResourceInterfaceinsteadWoohooLabs\Yin\JsonApi\Schema\Error: useWoohooLabs\Yin\JsonApi\Schema\Error\ErrorinsteadWoohooLabs\Yin\JsonApi\Schema\ErrorSource: useWoohooLabs\Yin\JsonApi\Schema\Error\ErrorSourceinsteadWoohooLabs\Yin\JsonApi\Exception\JsonApiException: useWoohooLabs\Yin\JsonApi\Exception\AbstractJsonApiExceptioninsteadWoohooLabs\Yin\JsonApi\Request\Request: useWoohooLabs\Yin\JsonApi\Request\JsonApiRequestinsteadWoohooLabs\Yin\JsonApi\Request\RequestInterface: useWoohooLabs\Yin\JsonApi\Request\JsonApiRequestInterfaceinsteadWoohooLabs\Yin\JsonApi\Schema\Link: useWoohooLabs\Yin\JsonApi\Schema\Link\LinkinsteadWoohooLabs\Yin\JsonApi\Schema\LinkObject: useWoohooLabs\Yin\JsonApi\Schema\Link\LinkObjectinstead
- Various deprecated methods (BREAKING CHANGE):
AbstractErrorDocument::getResponseCode()(useAbstractErrorDocument::getStatusCode()instead)RequestValidator::lintBody()(useRequestValidator::validateJsonBody()instead)ResponseValidator::lintBody()(useResponseValidator::validateJsonBody()instead)ResponseValidator::validateBody()(ResponseValidator::validateJsonApiBody())
- The deprecated
AbstractRelationship::omitWhenNotIncluded()method (BREAKING CHANGE): useAbstractRelationship::omitDataWhenNotIncluded()
FIXED:
- Issues with 0 and non-numeric values when using built-in pagination objects (
PageBasedPagination,FixedPageBasedPagination,OffsetBasedPagination) - Various issues found by static analysis
- Query parameters of pagination links were not encoded properly
- The
pageandfilterquery parameters must have an array value as per the spec - Instead of returning null, an exception is thrown when a non-existent relationship is fetched
3.1.1
DEPRECATED:
ToOneRelationship::omitWhenNotIncluded(): UseToOneRelationship::omitDataWhenNotIncluded()ToManyRelationship::omitWhenNotIncluded(): UseToManyRelationship::omitDataWhenNotIncluded()
4.0.0-beta2
REMOVED:
- The deprecated
AbstractRelationship::omitWhenNotIncluded()method (BREAKING CHANGE): useAbstractRelationship::omitDataWhenNotIncluded()
FIXED:
- Regression with uninitialized Resource properties
- Regression with the source pointer of the
ResourceTypeUnacceptableerror