Download the PHP package matmar10/rest-api-bundle without Composer
On this page you can find all versions of the php package matmar10/rest-api-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download matmar10/rest-api-bundle
More information about matmar10/rest-api-bundle
Files in matmar10/rest-api-bundle
Package rest-api-bundle
Short Description A Symfony Bundle that enables the use of @Api annotation to automatically serialize any return value from any controller using JMS Serializer.
License Apache
Informations about the package rest-api-bundle
REST API Bundle
A Symfony Bundle that enables the use of @Api annotation to automatically serialize any return value from any controller using JMS Serializer.
This bundle uses the popular (JMS Serializer Bundle)[https://github.com/schmittjoh/JMSSerializerBundle] for all serialization.
JMS Serialize annotation entities are serialized accordingly.
Installation
Add to your Symfony project composer file:
Add the bundle to the Kernel and run composer update:
Annotate a controller method; return value will automatically be serialized into JSON or XML:
Options
The @Api annotation is used to indicate a controller or method return result should be serialized into a json or xml response (or any other configured serialization type accepted by your JMS Serializer bundle).
The value of the @Api annotation indicates the serialization type:
You can also specify a different default status code (for example, when an entity is created):
Exceptions
Exceptions are automatically serialized into the desired serialization format.
All versions of rest-api-bundle with dependencies
symfony/symfony Version 2.4.*
symfony/framework-bundle Version 2.4.*
symfony/monolog-bundle Version ~2.4
jms/serializer Version 0.15.*
jms/serializer-bundle Version ~0.13
doctrine/doctrine-bundle Version 1.2.*