Download the PHP package alcalyn/serializable-api-response without Composer
On this page you can find all versions of the php package alcalyn/serializable-api-response. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alcalyn/serializable-api-response
More information about alcalyn/serializable-api-response
Files in alcalyn/serializable-api-response
Package serializable-api-response
Short Description Allows to return raw object as controller response so that it will be serialized later by serializer and converted to Symfony Response.
License MIT
Homepage https://github.com/alcalyn/serializable-api-response
Informations about the package serializable-api-response
Serializable Api Response
If you use Symfony Http foundation and JMS Serializer, this library allows to return raw objects and status code as a controller response so that it will be serialized later by serializer and converted to a Symfony Response.
The problem: Symfony converts response content to string if we use Symfony Response, or if we return a raw object and use a filter listener, then we can't pass status code.
Installation
Install via composer
Usage
Return a non-yet-serialized response in your controller:
Register ApiResponse Filter Listener:
In Silex:
License
This project is under MIT Lisense
All versions of serializable-api-response with dependencies
jms/serializer Version ~1.1|~2.0
symfony/http-foundation Version ~2.0|~3.0|~4.0
symfony/http-kernel Version ~2.0|~3.0|~4.0