woohoolabs/yin
PSR-7–compatible PHP framework for building JSON:API servers. Provides documents, resources, hydrators, request/response validation, pagination, relationship handling, content negotiation, middleware support, and custom serialization/deserialization.
FIXED:
ADDED:
CHANGED:
FIXED:
ADDED:
CHANGED:
This release is the same as 4.0.0-beta2. The full change set is the following:
ADDED:
type links in errorsResources can also use the $object property to access the object which is being transformedLinks class
DocumentLinksResourceLinksRelationshipLinksErrorLinksPaginationFactory class to decouple Pagination class instantiation from the requestJsonApi::getPaginationFactory() method to make it easier to retrieve the Pagination FactoryFixedCursorBasedPagination class which preserves the original behaviour of the changed CursorBasedPaginationFixedCursorBasedPaginationProviderTrait for using it in connection with FixedCursorBasedPaginationFixedPageBasedPaginationLinkProviderTrait for using it in connection with FixedPageBasedPaginationResponseInterface::hasToOneRelationship() to determine if a specific To-One relationship existsResponseInterface::hasToManyRelationship() to determine if a specific To-Many relationship existsCHANGED:
justinrainbow/json-schema to v5.2Documents should use the $object property instead of $domainObject (BREAKING CHANGE)AbstractSuccessfulDocument::getLinks() returns ?DocumentLinks instead of ?LinksAbstractErrorDocument::getLinks() returns ?DocumentLinks instead of ?LinksErrorDocument::getLinks() returns ?DocumentLinks instead of ?LinksErrorDocument::setLinks() expects a parameter of ?DocumentLinks type instead of ?LinksAbstractResource::getLinks() returns ?ResourceLinks instead of LinksAbstractRelationship::getLinks() returns ?RelationshipLinks instead of LinksAbstractRelationship::setLinks() expects a parameter of ?RelationshipLinks type instead of LinksError::getLinks() returns ErrorLinks instead of LinksError::setLinks() expects a parameter of ErrorLinks instead of LinksJsonApiExceptionInterface (BREAKING CHANGE):
JsonApiExceptionInterface now extends ThrowableJsonApiExceptionInterface::getErrorDocument() must return an ErrorDocumentInterface instead of an AbstractErrorDocument$defaultSize constructor parameter was added to CursorBasedPagination to define a default value for the page[size] query parameterFixedPageBasedPagination became non-nullableOffsetBasedPagination became non-nullablePageBasedPagination became non-nullablePaginationLinkProviderInterface expect a second parameter with a $queryString nameContent-Type header of the JSON:API response is done by the Responder by default instead of Serializers (BREAKING CHANGE):
Responder class sets the status code and the Content-Type header of the response, while custom Serializers can override them optionallySerializerInterface::serialize() only accepts two arguments instead of 3 as the $responseCode parameter was removedJsonSerializer does not set the Content-Type header and the status code of the response anymoreResponseInterface::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 existTransformerTrait::fromSqlToIso8601Time() method expects a ?DateTimeZone as its second argument instead of string (BREAKING CHANGE)REMOVED:
Links class (BREAKING CHANGE)RequestInterface (BREAKING CHANGE):
RequestInterface::getFixedPageBasedPagination()RequestInterface::getPageBasedPagination()RequestInterface::getOffsetBasedPagination()RequestInterface::getCursorBasedPagination()WoohooLabs\Yin\JsonApi\Document\AbstractCollectionDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractCollectionDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractErrorDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractErrorDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSimpleResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSimpleResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSingleResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSingleResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSuccessfulResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSuccessfulResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\ErrorDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\ErrorDocument insteadWoohooLabs\Yin\JsonApi\Transformer\AbstractResourceTransformer: use WoohooLabs\Yin\JsonApi\Schema\Resource\AbstractResource insteadWoohooLabs\Yin\JsonApi\Transformer\ResourceTransformerInterface: use WoohooLabs\Yin\JsonApi\Schema\Resource\ResourceInterface insteadWoohooLabs\Yin\JsonApi\Schema\Error: use WoohooLabs\Yin\JsonApi\Schema\Error\Error insteadWoohooLabs\Yin\JsonApi\Schema\ErrorSource: use WoohooLabs\Yin\JsonApi\Schema\Error\ErrorSource insteadWoohooLabs\Yin\JsonApi\Exception\JsonApiException: use WoohooLabs\Yin\JsonApi\Exception\AbstractJsonApiException insteadWoohooLabs\Yin\JsonApi\Request\Request: use WoohooLabs\Yin\JsonApi\Request\JsonApiRequest insteadWoohooLabs\Yin\JsonApi\Request\RequestInterface: use WoohooLabs\Yin\JsonApi\Request\JsonApiRequestInterface insteadWoohooLabs\Yin\JsonApi\Schema\Link: use WoohooLabs\Yin\JsonApi\Schema\Link\Link insteadWoohooLabs\Yin\JsonApi\Schema\LinkObject: use WoohooLabs\Yin\JsonApi\Schema\Link\LinkObject insteadAbstractErrorDocument::getResponseCode() (use AbstractErrorDocument::getStatusCode() instead)RequestValidator::lintBody() (use RequestValidator::validateJsonBody() instead)ResponseValidator::lintBody() (use ResponseValidator::validateJsonBody() instead)ResponseValidator::validateBody() (ResponseValidator::validateJsonApiBody())AbstractRelationship::omitWhenNotIncluded() method (BREAKING CHANGE): use AbstractRelationship::omitDataWhenNotIncluded()FIXED:
PageBasedPagination, FixedPageBasedPagination, OffsetBasedPagination)page and filter query parameters must have an array value as per the specDEPRECATED:
ToOneRelationship::omitWhenNotIncluded(): Use ToOneRelationship::omitDataWhenNotIncluded()ToManyRelationship::omitWhenNotIncluded(): Use ToManyRelationship::omitDataWhenNotIncluded()REMOVED:
AbstractRelationship::omitWhenNotIncluded() method (BREAKING CHANGE): use AbstractRelationship::omitDataWhenNotIncluded()FIXED:
ResourceTypeUnacceptable errorADDED:
type links in errors$object property to access the object which is being transformedLinks class
DocumentLinksResourceLinksRelationshipLinksErrorLinksPaginationFactory class to decouple Pagination class instantiation from the requestJsonApi::getPaginationFactory() method to make it easier to retrieve the Pagination FactoryFixedCursorBasedPagination class which preserves the original behaviour of the changed CursorBasedPaginationFixedCursorBasedPaginationProviderTrait for using it in connection with FixedCursorBasedPaginationFixedPageBasedPaginationLinkProviderTrait for using it in connection with FixedPageBasedPaginationResponseInterface::hasToOneRelationship() to determine if a specific To-One relationship existsResponseInterface::hasToManyRelationship() to determine if a specific To-Many relationship existsCHANGED:
justinrainbow/json-schema to v5.2Documents should use the $object property instead of $domainObject (BREAKING CHANGE)AbstractSuccessfulDocument::getLinks() returns ?DocumentLinks instead of ?LinksAbstractErrorDocument::getLinks() returns ?DocumentLinks instead of ?LinksErrorDocument::getLinks() returns ?DocumentLinks instead of ?LinksErrorDocument::setLinks() expects a parameter of ?DocumentLinks type instead of ?LinksAbstractResource::getLinks() returns ?ResourceLinks instead of LinksAbstractRelationship::getLinks() returns ?RelationshipLinks instead of LinksAbstractRelationship::setLinks() expects a parameter of ?RelationshipLinks type instead of LinksError::getLinks() returns ErrorLinks instead of LinksError::setLinks() expects a parameter of ErrorLinks instead of LinksJsonApiExceptionInterface (BREAKING CHANGE):
JsonApiExceptionInterface now extends ThrowableJsonApiExceptionInterface::getErrorDocument() must return an ErrorDocumentInterface instead of an AbstractErrorDocument$defaultSize constructor parameter was added to CursorBasedPagination to define a default value for the page[size] query parameterFixedPageBasedPagination became non-nullableOffsetBasedPagination became non-nullablePageBasedPagination became non-nullablePaginationLinkProviderInterface expect a second parameter with a $queryString nameContent-Type header of the JSON:API response is done by the Responder by default instead of Serializers (BREAKING CHANGE):
Responder class sets the status code and the Content-Type header of the response, while custom Serializers can override them optionallySerializerInterface::serialize() only accepts two arguments instead of 3 as the $responseCode parameter was removedJsonSerializer does not set the Content-Type header and the status code of the response anymoreResponseInterface::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 existTransformerTrait::fromSqlToIso8601Time() method expects a ?DateTimeZone as its second argument instead of string (BREAKING CHANGE)REMOVED:
Links class (BREAKING CHANGE)RequestInterface (BREAKING CHANGE):
RequestInterface::getFixedPageBasedPagination()RequestInterface::getPageBasedPagination()RequestInterface::getOffsetBasedPagination()RequestInterface::getCursorBasedPagination()WoohooLabs\Yin\JsonApi\Document\AbstractCollectionDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractCollectionDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractErrorDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractErrorDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSimpleResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSimpleResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSingleResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSingleResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSuccessfulResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSuccessfulResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\ErrorDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\ErrorDocument insteadWoohooLabs\Yin\JsonApi\Transformer\AbstractResourceTransformer: use WoohooLabs\Yin\JsonApi\Schema\Resource\AbstractResource insteadWoohooLabs\Yin\JsonApi\Transformer\ResourceTransformerInterface: use WoohooLabs\Yin\JsonApi\Schema\Resource\ResourceInterface insteadWoohooLabs\Yin\JsonApi\Schema\Error: use WoohooLabs\Yin\JsonApi\Schema\Error\Error insteadWoohooLabs\Yin\JsonApi\Schema\ErrorSource: use WoohooLabs\Yin\JsonApi\Schema\Error\ErrorSource insteadWoohooLabs\Yin\JsonApi\Exception\JsonApiException: use WoohooLabs\Yin\JsonApi\Exception\AbstractJsonApiException insteadWoohooLabs\Yin\JsonApi\Request\Request: use WoohooLabs\Yin\JsonApi\Request\JsonApiRequest insteadWoohooLabs\Yin\JsonApi\Request\RequestInterface: use WoohooLabs\Yin\JsonApi\Request\JsonApiRequestInterface insteadWoohooLabs\Yin\JsonApi\Schema\Link: use WoohooLabs\Yin\JsonApi\Schema\Link\Link insteadWoohooLabs\Yin\JsonApi\Schema\LinkObject: use WoohooLabs\Yin\JsonApi\Schema\Link\LinkObject insteadAbstractErrorDocument::getResponseCode() (use AbstractErrorDocument::getStatusCode() instead)RequestValidator::lintBody() (use RequestValidator::validateJsonBody() instead)ResponseValidator::lintBody() (use ResponseValidator::validateJsonBody() instead)ResponseValidator::validateBody() (ResponseValidator::validateJsonApiBody())FIXED:
PageBasedPagination, FixedPageBasedPagination, OffsetBasedPagination)page and filter query parameters must have an array value as per the specnull, an exception is thrown when a non-existent relationship is fetchedThis is a release with several deprecations in order to ensure forward compatibility with Yin 4.0.
DEPRECATED:
WoohooLabs\Yin\JsonApi\Document\AbstractCollectionDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractCollectionDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractErrorDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractErrorDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSimpleResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSimpleResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSingleResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSingleResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\AbstractSuccessfulResourceDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\AbstractSuccessfulResourceDocument insteadWoohooLabs\Yin\JsonApi\Document\ErrorDocument: use WoohooLabs\Yin\JsonApi\Schema\Document\ErrorDocument insteadWoohooLabs\Yin\JsonApi\Transformer\AbstractResourceTransformer: use WoohooLabs\Yin\JsonApi\Schema\Resource\AbstractResource insteadWoohooLabs\Yin\JsonApi\Transformer\ResourceTransformerInterface: use WoohooLabs\Yin\JsonApi\Schema\Resource\ResourceInterface insteadWoohooLabs\Yin\JsonApi\Schema\Error: use WoohooLabs\Yin\JsonApi\Schema\Error\Error insteadWoohooLabs\Yin\JsonApi\Schema\ErrorSource: use WoohooLabs\Yin\JsonApi\Schema\Error\ErrorSource insteadWoohooLabs\Yin\JsonApi\Exception\JsonApiException: use WoohooLabs\Yin\JsonApi\Exception\AbstractJsonApiException insteadWoohooLabs\Yin\JsonApi\Request\Request: use WoohooLabs\Yin\JsonApi\Request\JsonApiRequest insteadWoohooLabs\Yin\JsonApi\Request\RequestInterface: use WoohooLabs\Yin\JsonApi\Request\JsonApiRequestInterface insteadWoohooLabs\Yin\JsonApi\Schema\Link: use WoohooLabs\Yin\JsonApi\Schema\Link\Link insteadWoohooLabs\Yin\JsonApi\Schema\LinkObject: use WoohooLabs\Yin\JsonApi\Schema\Link\LinkObject insteadAbstractErrorDocument::getResponseCode(): use AbstractErrorDocument::getStatusCode() insteadRequestValidator::lintBody(): use RequestValidator::validateJsonBody() insteadResponseValidator::lintBody(): use ResponseValidator::validateJsonBody() insteadResponseValidator::validateBody(): use ResponseValidator::validateJsonApiBody() insteadFIXED:
fields, include and sort query parametersFIXED:
CHANGED:
ExceptionFactoryInterface methods must return JsonApiExceptionInterface (BREAKING)AbstractDocument::getJsonApi() and AbstractDocument::getLinks() return types must be declared (BREAKING)ResourceTransformerInterface::getLinks() return type must be declared (BREAKING)REMOVED:
TransformerTrait::toBool() and TransformerTrait::toInt() methodsFIXED:
CHANGED:
ExceptionFactoryInterface methods must return JsonApiExceptionInterface (BREAKING)AbstractDocument::getJsonApi() and AbstractDocument::getLinks() return types must be declared (BREAKING)ResourceTransformerInterface::getLinks() return type must be declared (BREAKING)REMOVED:
TransformerTrait::toBool() and TransformerTrait::toInt() methodsFIXED:
ADDED:
$code constructor argument of Exceptions when instantiating JsonApiExceptionsCHANGED:
FIXED:
CHANGED:
ADDED:
TransformerTrait::toIso8601Date() and TransformerTrait::toIso8601DateTime()CHANGED:
ADDED:
Responder::okWithRelationship() and Responder::createdWithRelationship()CHANGED:
AbstractSuccessfulDocument from Serializer and Response (BREAKING)JsonApi schema object to JsonApiObject in order to avoid ambiguities (BREAKING)DefaultSerializer to JsonSerializer (BREAKING)ExceptionFactoryInterface which didn't end with Exception (e.g. createRelationshipNotExists() to createRelationshipNotExistsException()) (BREAKING)validateRequest() method (BREAKING)HydratorTrait::getAcceptedType() was renamed to HydratorTrait::getAcceptedTypes() and it should always return an array
even if the hydrator can only accept one resource type (BREAKING)REMOVED:
RelationshipResponder::okWithMeta() method (BREAKING)JsonApi::respondWithRelationship() method (BREAKING)FIXED:
ADDED:
CHANGED:
validateRequest() method (BREAKING)FIXED:
ADDED:
CHANGED:
DefaultSerializer to JsonSerializer (BREAKING)ExceptionFactoryInterface which didn't end with Exception (e.g. createRelationshipNotExists() to createRelationshipNotExistsException()) (BREAKING)FIXED:
ADDED:
DefaultSerializerFIXED:
AbstractSimpleResourceDocument::getRelationshipContent() didn't return any valueADDED:
Responder::okWithRelationship() and Responder::createdWithRelationship()DefaultSerializerCHANGED:
AbstractSuccessfulDocument from Serializer and Response (BREAKING)JsonApi to JsonApiObject in order to avoid ambiguities (BREAKING)REMOVED:
RelationshipResponder::okWithMeta() method (BREAKING)JsonApi::respondWithRelationship() method (BREAKING)FIXED:
FIXED:
ADDED:
FIXED:
TransformerTrait() datetime transformer methods identify the ISO-8601 format correctlyHow can I help you explore Laravel packages today?