Releases: tobyzerner/json-api-server
Releases · tobyzerner/json-api-server
v1.0.0-beta.3
⚠️ Breaking Changes
- Drop
Interface
suffix from various interfaces:Resource
class renamed toAbstractResource
ResourceInterface
renamed toResource
CollectionInterface
renamed toCollection
ErrorProviderInterface
renamed toErrorProvider
PaginationInterface
renamed toPagination
EndpointInterface
renamed toEndpoint
TypeInterface
renamed toType
Fixed
v1.0.0-beta.2
⚠️ Breaking Changes
- Types are now their own construct instead of being subclasses of
Attribute
. See the Attributes documentation for more information. - Removed support for defining polymorphic relationships by passing a map of model classes to resource types. You should use heterogeneous collections instead. See the Relationships documentation for more information.
Added
- Add support for heterogeneous collections
- Add
Arr
type for defining array attributes (#88 by @bertramakers) - Laravel: Allow
WhereHas
field to be specified manually
Fixed
- When creating a resource, set the context model prior to field validation
- Fix error when updating a resource with a conflicting ID (#85)
- Laravel: Fix
Has
filter not working without ascope
- Laravel: Don't apply relationship loading constraints if there aren't any
v1.0.0-beta.1
Added
- Add
Str::enum()
method (#75 by @bertramakers) - Allow literal values in
Field::default()
method (#80 by @bertramakers)
Fixed
- Fix
Number
properties not being initialized - Fix validators not being run for null values
- Fix
DateTime
values containing milliseconds not being accepted - Fix nested filters not receiving correct resource in context
- Laravel: Fix
EloquentResource
sometimes using incorrect relation name when setting value - Laravel: Convert
DateTime
values to Laravel app's storage timezone - Laravel: Validate that
WhereBelongsTo
filter input is a list
v1.0.0-alpha.2
Added
- Finish Laravel integration
- Add basic field schema configuration in preparation for OpenAPI generation
- Add
Context::$query
to access the query used in theIndex
endpoint - Add
Context::fieldRequested()
andContext::sortRequested()
methods - Add
BooleanDateTime
attribute for exposing internal date-time values as booleans - Improve error sources in Bad Request errors
- Add a performance benchmark
Changed
- Add
void
return type toFilter::apply()
signature
Fixed
- Fix typed attribute values being deserialized and always passing validation
- Fix visibility callback result not being cast to a boolean
- Fix
Integer
incorrectly not extendingNumber
- Fix empty to-many relationships not being present in the response at all
- Fix TypeError when removing non-nullable to-one relationship
(#74)
v1.0.0-alpha.1
-
New class-based API. More ergonomic for managing large resource definitions and
inheriting/overriding behavior. Complex fields can be extracted into their own classes and
reused across resources. -
Typed attributes. Implementations of typed attributes are provided to match the data types
in the OpenAPI specification. Attributes can be marked as required and nullable. -
Customizable endpoints. Each endpoint is now opt-in for each resource and can be configured
and implemented separately. Also adds the ability for custom endpoints to be added. -
Restructured internals. The codebase is cleaner and easier to reason about, especially the
serialization process.
Still to come:
- Implementation of Laravel stuff (currently it is documented but not implemented)
- Ability to generate OpenAPI definitions
- Additional attribute types (array, object)
- Benchmarks (it should probably be a bit faster)
v0.2.0-beta.2
Added
- Content-Type validation and Accept negotation
- Include
jsonapi
object withversion
member in response - Validate implementation-specific query parameters according to specification
- Added
Location
header to201 Created
responses - Improved error repsonses when creating and updating resources
Context::filter()
method to get the value of a filterResourceType::applyScope()
,applyFilter()
andapplySort()
methodsResourceType::url()
method to get the URL for a modelForbidden
error details for CRUD actions, useful when running Atomic OperationsJsonApi::getExtensions()
method to get all registered extensionsConflictException
class
Changed
- Renamed
$linkage
parameter inAdapterInterface
methods to$linkageOnly
- Renamed
Type::newModel()
tomodel()
to be consistent with Adapter
Fixed
- Properly respond with meta information added to
Context
instance
v0.2.0-beta.1
Added
- Preliminary support for Extensions
- Support filtering by nested relationships/attributes (eg.
filter[relationship.attribute]=value
) - Add new methods to Context object:
getApi
,getPath
,fieldRequested
,meta
- Eloquent adapter: apply scopes when including polymorphic relationships
- Laravel validation helper: support nested validation messages
- Allow configuration of sort and filter visibility
- Add new
setId
method toAdapterInterface
Changed
- Change paradigm for eager loading relationships; allow fields to return
Deferred
values to be evaluated after all other fields, so that resource loading can be buffered. - Remove
on
prefix from field event methods
Removed
- Removed
load
anddontLoad
field methods
Fixed
- Fix pagination next link appearing when it shouldn't
v0.1.0-beta.1
Run on ubuntu-18.04 to preserve PHP 7.3