Download the PHP package sobored/mezzio-rest-helpers without Composer
On this page you can find all versions of the php package sobored/mezzio-rest-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sobored/mezzio-rest-helpers
More information about sobored/mezzio-rest-helpers
Files in sobored/mezzio-rest-helpers
Package mezzio-rest-helpers
Short Description Helper classes for building RESTful handlers in Mezzio
License BSD-3-Clause
Informations about the package mezzio-rest-helpers
Helpers for building RESTful handlers in Mezzio
Helpers and routes to help build a RESTful & HAL-compliant API in Mezzio.
Installation
Install this library using composer:
RestDispatchTrait
Use this trait for an easy way to create RESTful responses:
Exceptions
SoBoRed/mezzio-rest-helpers comes with helpful exceptions that use
mezzio/mezzio-problem-details
to produce human-readable responses for API errors. An example
response for NoResourceFoundException
, used above, would be:
Available exceptions
- Status 400: InvalidParameterException, OutOfBoundsException
- Status 405: MethodNotAllowedException
- Status 404: NoResourceFoundException
- Status 500: RuntimeException
Docs
For the problem details to be HAL-compliant, they should point to some form of documentation that helps the user understand the problem they are encountering. For this reason, mezzio-rest-helpers provides documentation and routes for it, which each exception's type points to.
Available doc routes
- /api/doc/invalid-parameter
- /api/doc/method-not-allowed-error
- /api/doc/resource-not-found
- /api/doc/parameter-out-of-range
- /api/doc/runtime-error
All versions of mezzio-rest-helpers with dependencies
mezzio/mezzio-problem-details Version ^1.4
mezzio/mezzio-hal Version ^2.2
laminas/laminas-diactoros Version ^2.14
mezzio/mezzio Version ^3.6