PHPackages                             innmind/rest-server-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. innmind/rest-server-bundle

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

innmind/rest-server-bundle
==========================

Symfony integration of innmind/rest-server

3.0.0(8y ago)0129MITPHPPHP ~7.1

Since Jul 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Innmind/RestServerBundle)[ Packagist](https://packagist.org/packages/innmind/rest-server-bundle)[ Docs](http://github.com/Innmind/RestServerBundle)[ RSS](/packages/innmind-rest-server-bundle/feed)WikiDiscussions develop Synced 2mo ago

READMEChangelogDependencies (10)Versions (15)Used By (0)

REST Server Bundle
==================

[](#rest-server-bundle)

`master``develop`[![Scrutinizer Code Quality](https://camo.githubusercontent.com/fb366ea2d5bb2838bb6ede0863c55a28e45f0499764868532834e3fb164bf9ff/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e6e6d696e642f5265737453657276657242756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Innmind/RestServerBundle/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f16302e51a2a7931e0fd09e3ea03d72e231a04489b75e570114cc057989b203d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e6e6d696e642f5265737453657276657242756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/Innmind/RestServerBundle/?branch=develop)[![Code Coverage](https://camo.githubusercontent.com/c53eee33e07f3a3f185a08163de52849042d2362841b5cc6de98f9040f90b2a2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e6e6d696e642f5265737453657276657242756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Innmind/RestServerBundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/120c1f22e1125057398842c159d5cf9eb80787df2f2bcb18ac6e964fa92d88ab/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e6e6d696e642f5265737453657276657242756e646c652f6261646765732f636f7665726167652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/Innmind/RestServerBundle/?branch=develop)[![Build Status](https://camo.githubusercontent.com/9a45ef8167162310335eaa102d800daaab09c5b1b5900edd953aa88cdff8f4ee/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e6e6d696e642f5265737453657276657242756e646c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Innmind/RestServerBundle/build-status/master)[![Build Status](https://camo.githubusercontent.com/72ddb78e256f803c5b614058d7fb34afd7308ee78039930a61a4fcb9a8591297/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e6e6d696e642f5265737453657276657242756e646c652f6261646765732f6275696c642e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/Innmind/RestServerBundle/build-status/develop)[![SensioLabsInsight](https://camo.githubusercontent.com/9c5947ac1a7f3f7a23941d434b9dc976c50dafcac2bf1f0893cb5a0203c1c732/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f36626136646463342d366463352d346133332d396635612d3164393132396461626537362f6269672e706e67)](https://insight.sensiolabs.com/projects/6ba6ddc4-6dc5-4a33-9f5a-1d9129dabe76)

Installation
------------

[](#installation)

Via composer:

```
composer require innmind/rest-server-bundle
```

Enable the bundle by adding the following line in your app/AppKernel.php of your project:

```
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Innmind\Rest\InnmindRestServerBundle,
        );
        // ...
    }
    // ...
}
```

Then you need to specify the types you allow in the app, here's an example:

```
innmind_rest_server:
    accept:
        json:
            priority: 10
            media_types:
                application/json: 0
        html:
            priority: 0
            media_types:
                text/html: 10
                application/xhtml+xml: 0
    content_type:
        json:
            priority: 0
            media_types:
                application/json: 0
```

Here you define you can expose your resources either in `json` or `html`. If the client accept any kind of content, it will automatically expose data as `json` as it has the highest priority. The client can use either `text/html` or `application/xhtml+xml` as media type in his `Accept` header in order for us to expose data as `html`.

We also describe the fact resources sent to our API must me in `json` only, and that the `Content-Type` header sent by the client must be `application/json` otherwise he will get an error.

In order to work properly, any media type here must have a corresponding [serializer encoder](https://github.com/symfony/serializer/blob/3.0/Encoder/EncoderInterface.php) (the `supportsEnconding` must check the `request_{media_type}` format, [example](https://github.com/Innmind/rest-server/blob/master/src/Serializer/Encoder/JsonEncoder.php)).

Then you need to activate the router by adding this configuration:

```
# app/config/routing.yml
rest:
    type: innmind_rest
    resource: .
```

The last part of the configuration is to create a file named `rest.yml` in your bundle under the folder `Resources/config` that will contain the definition of your resources. Here's an extended example:

```
blog:
    resources:
        blog:
            identity: uuid
            gateway: command
            properties:
                uuid:
                    type: string
                title:
                    type: string
                    access: [READ, CREATE, UPDATE]
                content:
                    type: string
                    access: [READ, CREATE, UPDATE]
                tags:
                    type: set
                    options:
                        inner: string
                author:
                    type: string # identifier of the author
    children:
        meta:
            resources:
                author:
                    identity: uuid
                    gateway: command
                    properties:
                        uuid:
                            type: string
                        name:
                            type: string
```

Now that all the configuration is done, you need to create a service implementing the interface [`GatewayInterface`](https://github.com/Innmind/rest-server/blob/master/src/GatewayInterface.php) and tag the service definition with `innmind_rest_server.gateway` along with an alias to your choosing; the alias is the one you'll use in the configuration of your resources as chown above (which in our case is `command`).

Such a service definition should look like this:

```
services:
    my_gateway:
        class: AppBundle\Gateway\MyGateway
        tags:
            - { name: innmind_rest_server.gateway, alias: command }
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~61 days

Total

13

Last Release

3148d ago

Major Versions

1.1.1 → 2.0.02017-02-27

2.0.0 → 3.0.02017-09-30

PHP version history (2 changes)1.0.0PHP ~7.0

2.0.0PHP ~7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (120 commits)")

---

Tags

apirest

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/innmind-rest-server-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/innmind-rest-server-bundle/health.svg)](https://phpackages.com/packages/innmind-rest-server-bundle)
```

###  Alternatives

[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)[api-platform/validator

API Platform validator component

223.2M10](/packages/api-platform-validator)[handcraftedinthealps/rest-routing-bundle

This bundle provides automatic route registration for the Controllers

582.0M2](/packages/handcraftedinthealps-rest-routing-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
