PHPackages                             kv4nt/yii2-oas3 - 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. kv4nt/yii2-oas3

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

kv4nt/yii2-oas3
===============

Yii2 Open Api Swagger 3 integration

1.0.2(3y ago)0259MITPHPPHP &gt;=7.1

Since Nov 9Pushed 3y agoCompare

[ Source](https://github.com/kv4nt/yii2-oas3)[ Packagist](https://packagist.org/packages/kv4nt/yii2-oas3)[ RSS](/packages/kv4nt-yii2-oas3/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (2)Used By (0)

Open Api Swagger 3 for Yii2 Framework
=====================================

[](#open-api-swagger-3-for-yii2-framework)

Requirements
------------

[](#requirements)

- PHP 7.1
- Yii2 Framework

Installation
------------

[](#installation)

The preferred way to install this wrapper is through [composer](http://getcomposer.org/download/).

```
php composer.phar require kv4nt/yii2-oas3 "*"
```

or

```
composer require kv4nt/yii2-oas3 "*"
```

or add to the require section of `composer.json`

```
"kv4nt/yii2-oas3" : "*"

```

Integration
-----------

[](#integration)

Add action to web controller (for example SiteController.php):

```
public function actions()
{
    return [
        'api-docs' => [
            'class' => 'kv4nt\swagger\ViewAction',
            'apiJsonUrl' => \yii\helpers\Url::to(['/site/api-json'], true),
        ],
        'api-json' => [
            'class' => 'kv4nt\swagger\JsonAction',
            'dirs' => [
                Yii::getAlias('@api/modules/api/controllers'),
                Yii::getAlias('@api/modules/api/models'),
                Yii::getAlias('@api/models'),
            ],
        ],
    ];
}
```

Open Api Swagger 3 example annotation
-------------------------------------

[](#open-api-swagger-3-example-annotation)

Api server description

```
/**
 * @OA\Info(
 *   version="1.0",
 *   title="Application API",
 *   description="Server - Mobile app API",
 *   @OA\Contact(
 *     name="John Smith",
 *     email="john@example.com",
 *   ),
 * ),
 * @OA\Server(
 *   url="https://example.com/api",
 *   description="main server",
 * )
 * @OA\Server(
 *   url="https://dev.example.com/api",
 *   description="dev server",
 * )
 */

class DefaultController extends Controller
{
...
```

Controller annotation

```
/**
 * @OA\Get(path="/",
 *   summary="Handshake",
 *   tags={"handshake"},
 *   @OA\Parameter(
 *     name="access-token",
 *     in="header",
 *     required=false,
 *     @OA\Schema(
 *       type="string"
 *     )
 *   ),
 *   @OA\Response(
 *     response=200,
 *     description="Returns Hello object",
 *     @OA\MediaType(
 *         mediaType="application/json",
 *         @OA\Schema(ref="#/components/schemas/Hello"),
 *     ),
 *   ),
 * )
 */
public function actionIndex()
{
...
```

Model annotation

```
/**
 *@OA\Schema(
 *  schema="Hello",
 *  @OA\Property(
 *     property="message",
 *     type="string",
 *     description="Text message"
 *  ),
 *  @OA\Property(
 *     property="time",
 *     type="integer",
 *     description="Server current Unix time"
 *  ),
 *  @OA\Property(
 *     property="date",
 *     type="string",
 *     format="date-time",
 *     description="Server current date time"
 *  )
 *)
 */
class Hello extends Model
{
...
```

Donate
------

[](#donate)

[![](https://camo.githubusercontent.com/f72973a690601ae9170128b07e34a821c2010aac81e1d0e2104e23cbb171e7e0/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f52552f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2PURUX2SHUD9E)

LICENSE
-------

[](#license)

This curl wrapper is released under the [MIT license](https://github.com/walkor/workerman/blob/master/MIT-LICENSE.txt).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d15ae5e94c57df8fb20e66d0d860cc741c2a6f6b2c2fb9d5dd323bb7f9a529c?d=identicon)[kv4nt](/maintainers/kv4nt)

---

Top Contributors

[![genxoft](https://avatars.githubusercontent.com/u/26364719?v=4)](https://github.com/genxoft "genxoft (6 commits)")[![albertborsos](https://avatars.githubusercontent.com/u/7307145?v=4)](https://github.com/albertborsos "albertborsos (1 commits)")[![kv4nt](https://avatars.githubusercontent.com/u/8049164?v=4)](https://github.com/kv4nt "kv4nt (1 commits)")

---

Tags

jsonrestswaggeryii2restfullopen-api

### Embed Badge

![Health badge](/badges/kv4nt-yii2-oas3/health.svg)

```
[![Health](https://phpackages.com/badges/kv4nt-yii2-oas3/health.svg)](https://phpackages.com/packages/kv4nt-yii2-oas3)
```

###  Alternatives

[genxoft/yii2-oas3

Yii2 Open Api Swagger 3 integration

18346.3k1](/packages/genxoft-yii2-oas3)[api-platform/json-schema

Generate a JSON Schema from a PHP class

273.4M26](/packages/api-platform-json-schema)[tuyakhov/yii2-json-api

Implementation of JSON API specification for the Yii framework

140115.6k](/packages/tuyakhov-yii2-json-api)[outeredge/swagger-module

Laminas Framework Module for Swagger resource file generation

23112.1k](/packages/outeredge-swagger-module)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
