PHPackages                             srio/api-doc-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. srio/api-doc-bundle

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

srio/api-doc-bundle
===================

Generates documentation for your REST API from annotations

2.4.2(12y ago)0140MITPHP

Since May 23Pushed 11y ago1 watchersCompare

[ Source](https://github.com/sroze/NelmioApiDocBundle)[ Packagist](https://packagist.org/packages/srio/api-doc-bundle)[ RSS](/packages/srio-api-doc-bundle/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (12)Versions (21)Used By (0)

NelmioApiDocBundle
==================

[](#nelmioapidocbundle)

[![Build Status](https://camo.githubusercontent.com/4c90732e37f37c9d669d84d2a27e57179ee97a908cee1981d53557cc842e6b9b/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6e656c6d696f2f4e656c6d696f417069446f6342756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/nelmio/NelmioApiDocBundle)

The **NelmioApiDocBundle** bundle allows you to generate a decent documentation for your APIs.

**Important:** This bundle is developed in sync with [symfony's repository](https://github.com/symfony/symfony). For Symfony 2.0.x, you need to use the 1.\* version of the bundle.

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

[](#installation)

Add this bundle to your `composer.json` file:

```
{
    "require": {
        "nelmio/api-doc-bundle": "dev-master"
    }
}

```

Register the bundle in `app/AppKernel.php`:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
    );
}

```

Import the routing definition in `routing.yml`:

```
# app/config/routing.yml
NelmioApiDocBundle:
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
    prefix:   /api/doc

```

Enable the bundle's configuration in `app/config/config.yml`:

```
# app/config/config.yml
nelmio_api_doc: ~

```

Usage
-----

[](#usage)

The main problem with documentation is to keep it up to date. That's why the **NelmioApiDocBundle**uses introspection a lot. Thanks to an annotation, it's really easy to document an API method.

### The ApiDoc() annotation

[](#the-apidoc-annotation)

The bundle provides an `ApiDoc()` annotation for your controllers:

```
