PHPackages                             cblink/hyperf-yapi-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. [API Development](/categories/api)
4. /
5. cblink/hyperf-yapi-doc

ActiveLibrary[API Development](/categories/api)

cblink/hyperf-yapi-doc
======================

Package description here.

v0.4.0(1y ago)08132MITPHPPHP &gt;=8.1

Since Nov 30Pushed 1y ago3 watchersCompare

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

READMEChangelogDependencies (4)Versions (13)Used By (2)

 hyperf-yapi-doc
=================

[](#-hyperf-yapi-doc-)

 .

Installing
----------

[](#installing)

```
$ composer require cblink/hyperf-yapi-doc -vvv
```

### 配置说明

[](#配置说明)

配置比较麻烦，先凑合着用吧，这个等有空了再改

```
return [
   // yap请求地址
       'base_url' => 'http://yapi.cblink.net/',
       // 文档合并方式，"normal"(普通模式) , "good"(智能合并), "merge"(完全覆盖)
       'merge' => 'merge',

        // token配置
       'config' => [
            // key名称可以自定义，默认是 default ，可以增加多个token配置
           'default' => [
                // yapi project id
               'id' => 1,
                // yapi project token
               'token' => 'xxxxxx'
           ],
       ],

       'public' => [
           // 返回值前缀
           'prefix' => 'data',

           // 公共的请求参数,query部分
           'query' => [
                // 格式 key => [] , key为返回值名称
                // plan 的返回参数说明，
                // must，无论接口返回是否返回，都出现在yapi文档中
                // required，是否必须填写
               'page' => ['plan' => '页码，默认1'],
               'page_size' => ['plan' => '每页数量，不超过200，默认15'],
               'is_all' => ['plan' => '是否获取全部数据，不超过1000条'],
           ],

           // 公共的响应参数
           'data' => [
                // 格式 key => [] , key为返回值名称
                // plan 的返回参数说明，
                // must，无论接口返回是否返回，都出现在yapi文档中
                // required，是否必须出现
                // children，子集信息，参数和上边一样
               'err_code' => ['plan' => '错误码，0表示成功', 'must' => true, 'required' => true],
               'err_msg' => ['plan' => '错误说明，请求失败时范湖', 'must' => true],
               'meta' => [
                   'plan' => '分页数据',
                   'must' => false,
                   'children' => [
                       'current_page' => ['plan' => '当前页数'],
                       'total' => ['plan' => '总数量'],
                       'per_page' => ['plan' => '每页数量'],
                   ]
               ]
           ]
];
```

### 使用

[](#使用)

看下面示例使用

```
use HyperfTest\TestCase;

class BaseTestCase extends TestCase
{
    public function test_store_products()
    {
        // 接口请求
         $res = $this->post('/api/product', [
            'product_name' => '商品名称',
            'price' => 500
        ]);

        $this->assertXXX($res);

        // 参数 dto
        $dto = new \Cblink\YApiDoc\YapiDTO([
            // 这里天多项会同时发布到多个项目组中
            'project' => ['default', 'custom'],
            'name' => '接口名称',
            'category' => '接口分组',
            'request' => [
                // 参数 => 参数说明
                'product_name' => '商品名称'
            ],
            // 非必填排除
            'request_expect' => [],
            'response' => [
                // 数组的说明,如果是需要给数组加说明，需要带上*
                // 多层级可以嵌套,   *.products.*.name => '订单商品名称'
                '*.name' => '',
                'price' => '价格'
            ],
            // 允许非必须返回的字段
            'response_expect'=>[
                '*' => ['name', 'price'],
                'price',
                'aaa' => ['name']
            ]
        ]);

        $yapi = new \Cblink\YApiDoc\YApi($request, $response, $dto);

        // 生成文件
        $yapi->make();
    }
}
```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/cblink/hyperf-yapi-doc/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/cblink/hyperf-yapi-doc/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance46

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~120 days

Recently: every ~188 days

Total

11

Last Release

421d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.4

v0.4.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a33f3d22f7c5ba81df984215eda327fe21f224f59a8a8cb404138042ec9f788?d=identicon)[overnic](/maintainers/overnic)

---

Top Contributors

[![elevenwd](https://avatars.githubusercontent.com/u/27636308?v=4)](https://github.com/elevenwd "elevenwd (1 commits)")

### Embed Badge

![Health badge](/badges/cblink-hyperf-yapi-doc/health.svg)

```
[![Health](https://phpackages.com/badges/cblink-hyperf-yapi-doc/health.svg)](https://phpackages.com/packages/cblink-hyperf-yapi-doc)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

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

PHPackages © 2026

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