Generates documentation for your REST API from annotations
Find a file
2017-03-20 10:44:29 +01:00
Annotation Get ride of Swagger-Php parser 2017-03-16 19:52:18 +01:00
DependencyInjection Get ride of Swagger-Php parser 2017-03-16 19:52:18 +01:00
Describer Add return types 2017-03-17 19:37:51 +01:00
Model Add return types 2017-03-17 19:37:51 +01:00
ModelDescriber Add return types 2017-03-17 19:37:51 +01:00
Resources/config Get ride of Swagger-Php parser 2017-03-16 19:52:18 +01:00
RouteDescriber Handle FOSRestBundle QueryParam required QueryParams 2017-03-20 10:44:29 +01:00
Routing Change the vendor to "Nelmio" 2016-12-29 12:09:26 +01:00
SwaggerPhp Get ride of Swagger-Php parser 2017-03-16 19:52:18 +01:00
Tests Get ride of Swagger-Php parser 2017-03-16 19:52:18 +01:00
Util [SwaggerPhp] Only parse controllers 2017-01-25 18:44:57 +01:00
.gitignore Fix the tests 2017-03-15 13:38:23 +01:00
.php_cs.dist Allow implicit operations with SwaggerPhp annotations 2017-01-08 12:12:43 +01:00
.styleci.yml Fix CS 2016-07-30 20:04:03 +02:00
.travis.yml Fix the tests 2017-03-15 13:38:23 +01:00
ApiDocGenerator.php Add models support 2017-01-14 17:36:56 +01:00
composer.json Bump zircote/swagger-php version 2017-03-15 13:31:40 +01:00
CONTRIBUTING.md Re-add contributing informations 2016-12-29 13:35:36 +01:00
LICENSE Change the vendor to "Nelmio" 2016-12-29 12:09:26 +01:00
NelmioApiDocBundle.php Add models support 2017-01-14 17:36:56 +01:00
phpunit Fix the tests 2017-03-15 13:38:23 +01:00
phpunit.xml.dist Transform in a bundle 2016-07-12 00:33:55 +02:00
README.md Re-add contributing informations 2016-12-29 13:35:36 +01:00
UPGRADING-3.0.md Remove the @ApiDoc annotation 2017-01-09 12:21:53 +01:00

NelmioApiDocBundle

Build
Status Total Downloads Latest Stable
Version

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

Installation

Just like any bundle, you have to download it using composer:

composer require nelmio/api-doc-bundle dev-master

And then add it to your kernel:

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...

            new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
        ];

        // ...
    }
}

And that's all, no configuration needed!

What does this bundle?

It generates you a swagger documentation from your symfony app thanks to different sources called Describers. These Describers are specific to a library and extract data from it and merge it into your swagger documentation.

You can fetch your swagger documentation in your app:

$generator = $container->get('nelmio_api_doc.generator');
$swagger = $generator->generate()->toArray();

What's supported?

This bundle supports Symfony route requirements, PHP annotations, the ApiDoc annotation, Swagger-Php annotations, FOSRestBundle annotations and Api-Platform apps.

This bundle is a Work In Progress and as such it does only support input documentation for now (if you use Swagger-Php or Api-Platform, output is supported as well).

What's next?

The hardest part remain: models. We have to build something to manage models that can vary based on several factors (serialization groups, class, etc.) and then put it in the app's documentation.

Other libraries support might be added but the priority is to finalize the bundle first.

Contributing

See CONTRIBUTING file.

Running the Tests

Install the Composer dependencies:

git clone https://github.com/nelmio/NelmioApiDocBundle.git
cd NelmioApiDocBundle
composer update

Then, run the test suite using PHPUnit:

phpunit

License

This bundle is released under the MIT license.