2017 © Pedro Peláez
 

symfony-bundle api-doc-bundle

Generates documentation for your REST API from annotations

image

exsyst/api-doc-bundle

Generates documentation for your REST API from annotations

  • Saturday, June 24, 2017
  • by EXSyst
  • Repository
  • 5 Watchers
  • 1 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

ApiDocBundle

[WIP] Generates Swagger docs from several sources, (*1)

Installation

Just like any bundle, you have to download it using composer:, (*2)

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

And then add it to your kernel:, (*3)

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

            new EXSyst\Bundle\ApiDocBundle\ApiDocBundle(),
        ];

        // ...
    }
}

And that's all, no configuration needed!, (*4)

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., (*5)

You can fetch your swagger documentation in your app:, (*6)

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

What's supported?

This bundle supports Symfony route requirements, PHP annotations, Swagger-Php annotations, NelmioApiDocBundle annotation, FOSRestBundle annotations and Api-Platform apps., (*7)

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)., (*8)

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., (*9)

Other libraries support might be added but the priority is to finalize the bundle first., (*10)

The Versions