Skip to content

Use plain JSON media type

Choose a tag to compare

@arucard21 arucard21 released this 14 Jan 09:27
· 10 commits to master since this release

This release switches no longer uses HAL+JSON as media type to represent the API resources when accessing the API. Support for HAL+JSON was dropped in SimplyRESTful version 1.0.0. Instead, this TypeScript client now uses plain JSON by detecting the custom media type for the API resources.

This is a breaking change since HALResource and HALCollectionV2 were renamed to APIResource and APICollection. Instead of HALLink from the hal-types library, this now uses a custom Link object. These objects are also defined as interface instead of type now. Since type and interface are practically interchangeable, this release only provides the flexibility to choose which one you prefer instead of requiring an intersection type as it did before.

Migrating to this release mainly requires changing the names to their updated versions. Optionally, you can change your own API resource from an intersection type that intersects with HALResource to an interface that extends APIResource.