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

00PHP

Since Oct 30Pushed 6mo 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 1mo ago

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

Maintenance47

Moderate activity, may be stable

Popularity0

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://www.gravatar.com/avatar/2b47a628efd31e556867293e4ddbfd9a9f903d27da860e6298f842dccff7e386?d=identicon)[yjballestero](/maintainers/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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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