dokapi/dokapi-rest

This package is abandoned and no longer maintained. No replacement package was suggested.

Rest Documentation generator

Installs: 5 773

Dependents: 1

Suggesters: 0

Security: 0

Stars: 4

Watchers: 3

Forks: 0

Open Issues: 0

Type:standalone

v0.1.0 2014-02-17 11:39 UTC

This package is not auto-updated.

Last update: 2017-11-28 07:10:29 UTC


README

Use Dokapi to build Rest documentation.

Usage

<?php

use Doctrine\Common\Annotations\AnnotationRegistry;
use Dokapi\DokapiRest\Processor;

$loader = require __DIR__."/vendor/autoload.php";

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

$finder = new Symfony\Component\Finder\Finder();
$finder->in(__dir__.'/tests/fixtures/simple');

$processors = new Dokapi\Processor\Collection();
$processors->loadDefaultProcessors();
$processors->add(new Processor\Annotation\ApiProcessor());
$processors->add(new Processor\Annotation\ModelProcessor());
$processors->add(new Processor\Annotation\OperationProcessor());
$processors->add(new Processor\Annotation\ParameterProcessor());
$processors->add(new Processor\Annotation\ResourceProcessor());
$processors->add(new Processor\Annotation\ResponseProcessor());
$processors->add(new Processor\Annotation\DataTypePropertyProcessor());

$dokapi = new Dokapi\Dokapi($processors);
$result   = $dokapi->scan($finder);

$renderer = new \Dokapi\DokapiRest\Renderer\Swagger\FilesystemRenderer('gimme a directory');
$renderer->render($result);

Tree model

Api (src/Model/Api.php)
    -> Model (src/Model/Model.php)
    -> Resource (src/Model/Resource.php)
    ->  -> Operation (src/Model/Operation.php)
    ->  ->  -> Parameter (src/Model/Parameter.php)
    ->  ->  -> Response (src/Model/Response.php)

Todo

Replace typehint AbstractType by an interface.