PHPackages                             yjballestero/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. [API Development](/categories/api)
4. /
5. yjballestero/yii2-oas3

ActiveLibrary[API Development](/categories/api)

yjballestero/yii2-oas3
======================

Yii2 Open Api Swagger 3 integration

02PHP

Since Oct 30Pushed 8mo agoCompare

[ Source](https://github.com/YJBallestero/yii2-oas3)[ Packagist](https://packagist.org/packages/yjballestero/yii2-oas3)[ RSS](/packages/yjballestero-yii2-oas3/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

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

[](#requirements)

- PHP 8.0
- Yii2 Framework

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

[](#installation)

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

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

or

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

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

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

```

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

[](#integration)

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

```
public function actions()
{
    return [
        'api-docs' => [
            'class' => 'yjballestero\swagger\ViewAction',
            'apiJsonUrl' => \yii\helpers\Url::to(['/site/api-json'], true),
        ],
        'api-json' => [
            'class' => 'yjballestero\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
{
...
```

LICENSE
-------

[](#license)

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

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance43

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1728320?v=4)[Yan Ballestero](/maintainers/yjballestero)[@YJBallestero](https://github.com/YJBallestero)

---

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)")[![YJBallestero](https://avatars.githubusercontent.com/u/1728320?v=4)](https://github.com/YJBallestero "YJBallestero (1 commits)")

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k16](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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