PHPackages                             avtehnik/service-doc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. avtehnik/service-doc

ActiveLibrary[HTTP &amp; Networking](/categories/http)

avtehnik/service-doc
====================

service-doc - Generate interactive documentation for your RESTful API using phpdoc annotations

v0.1.3(5y ago)08.1kApache-2.0JavaScriptPHP &gt;=7.1

Since Jan 30Pushed 5y ago1 watchersCompare

[ Source](https://github.com/avtehnik/service-doc)[ Packagist](https://packagist.org/packages/avtehnik/service-doc)[ Docs](https://github.com/avtehnik/service-doc/)[ RSS](/packages/avtehnik-service-doc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Installation (with [Composer](https://getcomposer.org))
-------------------------------------------------------

[](#installation-with-composer)

```
composer require avtehnik/service-doc
```

Usage
-----

[](#usage)

Add annotations to your php files.

```
/**
 * @ServiceDoc\Info(title="My First API", version="0.1")
 */

/**
 * @ServiceDoc\PathItem(
 *     microservice="payment",
 *     path="/wallet-prices",
 *     method="get",
 *     @ServiceDoc\Tag(
 *          name="user",
 *     )
 * )
 * @param $destination_code
 * @param $source_code
 *
 * @return
 */
```

### Usage from Yii

[](#usage-from-yii)

Add servicedoc section to actions array

```
    class DocumentationController extends Controller
    {
        public function actions()
        {
            return [
                'servicedoc' => [
                    'class' => 'ServiceDoc\YiiServiceDocAction',
                    'scanDir' => [
                        Yii::getAlias('@common/components')
                    ],
                ],
            ];
        }
    }

```

and then you can access to docs with url `/documentation/servicedoc`

### Usage from php

[](#usage-from-php)

Generate always-up-to-date documentation.

```
