PHPackages                             osm/easy-rest-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. osm/easy-rest-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

osm/easy-rest-bundle
====================

Simple and lightweight bundle provides JSON based request / response and exception handling support to develop RESTful API's with Symfony.

1.5.1(7y ago)91.4k2MITPHPPHP ^5.5.9|~7.0CI failing

Since Nov 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/o/EasyRestBundle)[ Packagist](https://packagist.org/packages/osm/easy-rest-bundle)[ RSS](/packages/osm-easy-rest-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (9)Versions (8)Used By (0)

Easy Rest Bundle
================

[](#easy-rest-bundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/ab6aee4187cd575a977fe548942d4155352a716c9e616f2688a6e6b58699617b/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33366264336431382d313662312d346366322d386635382d3533643934306636376266312f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/36bd3d18-16b1-4cf2-8f58-53d940f67bf1)

Simple and lightweight bundle provides JSON based request / response and exception handling support to develop RESTful API's with Symfony.

Features include:

- Listener for decoding JSON request body and accessing it from Request class
- `ParamConverter` for mapping JSON request to plain PHP object (using Symfony Serializer)
- (New in 1.3.0) Supports nested objects and arrays using PHPDoc hints
- Listener for creating JSON responses which is converts to JSON
    - Automatically determines correct HTTP status codes for DELETE and POST response
- Exception controller for providing error details
    - Supports Symfony Validation errors
    - Provides stack-trace on development environment
- Supports Symfony 2 and 3
- Only uses plain listeners, easy to configure and disable certain features.

Not supports:

- XML serializer or format agnostic helpers
- Header format negotiation

Installation
============

[](#installation)

Step 1: Download the Bundle
---------------------------

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require osm/easy-rest-bundle "~1"

```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Step 2: Enable the Bundle
-------------------------

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `app/AppKernel.php` file of your project:

```
