Componette

Componette

baraja-core

baraja-core / structured-api-doc v1.1.2

Automatically generated documentation by parsing of Structured API endpoints.

download-cloud-line composer require baraja-core/structured-api-doc

Structured API Documentation

Fully automated tool for documentation.

📦 Installation

It's best to use Composer for installation, and you can also find the package on Packagist and GitHub.

To install, simply use the command:

$ composer require baraja-core/structured-api-doc

You can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.

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
{
   #[Inject]
   public ArticleManagerAccessor $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.

📄 License

baraja-core/structured-api-doc is licensed under the MIT license. See the LICENSE file for more details.

bar-chart-fill

Statistics

download-cloud-fill
1517
star-fill
2
bug-fill
1
flashlight-fill
42d
price-tag-2-line

Badges

guide-fill

Dependencies

php (>=7.1.0)
ext-json (*)
ext-mbstring (*)
ext-iconv (*)
Componette Componette felix@nette.org