baraja-core/structured-api-doc

There is no license information available for the latest version (v1.0.4) of this package.

Automatically generated documentation by parsing of Structured API endpoints.

v1.0.4 2020-07-28 10:43 UTC

This package is auto-updated.

Last update: 2020-08-02 18:47:45 UTC


README

Fully automated tool for documentation.

Idea

Imagine some API endpoint (implementing Baraja Structured API) like this:

/**
 * Common API endpoint for robust article manipulation.
 *
 * @endpointName Article manager
 */
final class ArticleEndpoint extends BaseEndpoint
{

   /**
    * @var ArticleManagerAccessor
    * @inject
    */
   public $articleManager;


   /**
    * @param string $locale in format "cs" or "en"
    * @param int $page real page number for filtering, 1 => first page ... "n" page
    * @param string|null $filterTitle filter by words in title?
    * @param string|null $filterFrom find all articles from this date
    * @param string|null $filterTo find all articles to this date
    */
   public function actionDefault(string $locale, int $page = 1, ?string $filterTitle = null, ?string $filterFrom = null, ?string $filterTo = null): void
   {
      // Here is some body...

You can simply type documentation to native PHP Doc blocks in your code and it will generate documentation automatically to HTML:

Rendered documentation about Article

For documentation simply open URI /api-documentation and your schema will be created automatically.