PHPackages                             baoziyoo/hyperf-api-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. baoziyoo/hyperf-api-doc

ActiveLibrary[API Development](/categories/api)

baoziyoo/hyperf-api-doc
=======================

A swagger library for Hyperf.

v1.1.5(1y ago)02.8kMITPHPPHP &gt;=8.2

Since Mar 9Pushed 1y agoCompare

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

READMEChangelog (7)Dependencies (8)Versions (8)Used By (0)

PHP Hyperf api doc
==================

[](#php-hyperf-api-doc)

介绍
==

[](#介绍)

> 基于 [tw2066/dto](https://github.com/tw2066/dto) [tw2066/api-docs](https://github.com/tw2066/api-docs) 框架改进而来，特别鸣谢tw2066/dto给的灵感

运行环境
====

[](#运行环境)

- php &gt;= 8.2
- hyperf &gt;= 3.0

安装
==

[](#安装)

```
composer require baoziyoo/hyperf-api-doc
php bin/hyperf.php vendor:publish baoziyoo/hyperf-api-doc
```

使用
==

[](#使用)

例子
--

[](#例子)

```
use Baoziyoo\Hyperf\ApiDocs\Annotation\Api;
use Baoziyoo\Hyperf\ApiDocs\Annotation\ApiHeader;
use Baoziyoo\Hyperf\ApiDocs\Annotation\ApiOperation;

#[Api(tags: 'demo管理')]
#[ApiHeader('token')]
#[ApiHeader('tokenType')]
class DemoController extends AbstractController
{
    #[ApiOperation('登陆')]
    public function index(#[RequestQuery] DemoQuery $request): Contact
    {
        $contact = new Contact();
        $contact->name = $request->name;
        var_dump($request);
        return $contact;
    }

    #[ApiOperation('更新token')]
    public function add(#[RequestBody] DemoBodyRequest $request, #[RequestQuery] DemoQuery $query)
    {
        var_dump($query);
        return json_encode($request, JSON_UNESCAPED_UNICODE);
    }

    public function fromData(#[RequestFormData] DemoFormData $formData): bool
    {
        $file = $this->request->file('photo');
        var_dump($file);
        var_dump($formData);
        return true;
    }
}
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.1% 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 ~105 days

Recently: every ~126 days

Total

7

Last Release

538d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0fffd75f2a474a2d346f999385504738cfe62ae96b8edf7c20f48ebbc8ce700?d=identicon)[baozi](/maintainers/baozi)

---

Top Contributors

[![tw2066](https://avatars.githubusercontent.com/u/24579418?v=4)](https://github.com/tw2066 "tw2066 (94 commits)")[![baoziyo](https://avatars.githubusercontent.com/u/35062657?v=4)](https://github.com/baoziyo "baoziyo (7 commits)")

---

Tags

phpswaggerdocshyperfhyperf swagger

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/baoziyoo-hyperf-api-doc/health.svg)

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

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[tangwei/apidocs

A swagger library for Hyperf.

51130.4k8](/packages/tangwei-apidocs)[hyperf/swagger

A swagger library for Hyperf.

19338.7k6](/packages/hyperf-swagger)[daodao97/apidog

A swagger library for Hyperf.

15040.1k1](/packages/daodao97-apidog)[harmbandstra/swagger-ui-bundle

Exposes swagger UI inside your Symfony project through a route (eg. /docs)

42867.3k](/packages/harmbandstra-swagger-ui-bundle)[kakuilan/hyperf-apihelper

hyperf api swagger helper

443.0k](/packages/kakuilan-hyperf-apihelper)

PHPackages © 2026

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