PHPackages                             daodao97/apidog - 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. daodao97/apidog

ActiveLibrary[API Development](/categories/api)

daodao97/apidog
===============

A swagger library for Hyperf.

1.5.18(4y ago)15040.1k↓20%28[10 issues](https://github.com/daodao97/apidog/issues)1MITPHPPHP &gt;=7.2

Since Oct 14Pushed 3y ago4 watchersCompare

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

READMEChangelogDependencies (8)Versions (28)Used By (1)

Api Watch Dog
-------------

[](#api-watch-dog)

一个 [Hyperf](https://github.com/hyperf/hyperf) 框架的 Api 参数校验及 swagger 文档生成组件

1. 根据注解自动进行Api参数的校验, 业务代码更纯粹.
2. 根据注解自动生成Swagger文档, 让接口文档维护更省心.

> 在 1.2 版本后, 本扩展移除了内部自定义的验证器, 只保留的 hyperf 原生验证器, 以保持验证规则的统一

旧版本文档 [查看](./README_OLD.md)

安装
--

[](#安装)

```
composer require daodao97/apidog

```

使用
--

[](#使用)

#### 1. 发布配置文件

[](#1-发布配置文件)

```
php bin/hyperf.php vendor:publish daodao97/apidog

# hyperf/validation 的依赖发布

php bin/hyperf.php vendor:publish hyperf/translation

php bin/hyperf.php vendor:publish hyperf/validation
```

### 2. 修改配置文件

[](#2-修改配置文件)

> 注意 与1.2及之前的版本相比, 配置文件结构及文件名 略有不同
>
> (1) 配置文件结构的优化, 增加了swagger外的整体配置
>
> (2) 配置文件的名称 由 swagger.php 改为 apidog.php

根据需求修改 `config/autoload/apidog.php`

```
