Skip to content

7.0.0 - Introduce versioned ExposableType API

Choose a tag to compare

@stephanschuler stephanschuler released this 28 May 23:41
· 2 commits to main since this release
cfed548

A single JSON-API type can now be exposed under multiple API versions
side-by-side. The internal array-based ExposableTypeMap configuration
is replaced by a typed ExposableType value object, named after the
ExposeType annotation already present in the AnnotationGenerics package.

BREAKING CHANGE: ExposableTypeMapInterface has been redesigned around
the new ExposableType value object and an explicit $apiVersion
parameter:

  • getType() -> getExposableTypeByClassIdentifier()
  • getClassName() -> getExposableTypeByTypeName($name, $apiVersion)
    -> getExposableTypeByVersionedTypeName()
  • getClassNameForProperty() -> getPropertyType($name, $apiVersion, $property)

New: static ExposableTypeMapInterface::forceApiVersion() pins the
active version inside a callable, and the NEXT_VERSION = 'next'
constant marks types belonging to an unreleased version.

ResourceInformationInterface has been tightened with full PHP return
and parameter types; existing implementations need to add matching
signatures.