Download the PHP package hyperf-plus/swagger without Composer

On this page you can find all versions of the php package hyperf-plus/swagger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package swagger

HPlus Swagger - 智能API文档生成组件

PHP Version Hyperf Version OpenAPI

一个为 Hyperf 框架打造的智能 API 文档生成组件,支持 OpenAPI 3.1.1 规范,自动集成路由和验证信息,生成美观的交互式文档。

✨ 核心特性

📦 安装

✅ 兼容性说明

本包支持无缝升级,完全向后兼容。主要改进:

注意:如果同时使用 Route 包,建议查看 Route 包的升级说明,因为路由生成规则有重大变化。

🚀 快速开始

1. 发布配置

2. 基础配置

编辑 config/autoload/swagger.php

3. 使用示例

4. 访问文档

启动服务后访问:http://localhost:9501/swagger

📋 注解说明

@ApiDefinition

定义数据模型(Schema):

@ApiServer

定义服务器信息:

@ApiCallback

定义回调信息:

@ApiLink

定义链接关系:

🎯 高级用法

1. 响应示例

使用 @ApiResponse@ApiResponseExample

2. 请求体示例

3. 文件上传

4. 安全认证

5. 分组和标签

🔧 配置详解

完整配置示例

🎨 UI 定制

自定义 UI 配置

🚀 性能优化

  1. 文档缓存

  2. 增量更新

    • 只更新修改的控制器
    • 智能检测文件变化
  3. 生产环境优化

🤝 与其他组件协作

Route 组件集成

Validate 组件集成

集成流程

📝 最佳实践

  1. 文档质量

    • 为每个接口添加 summary 和 description
    • 提供请求和响应示例
    • 使用有意义的标签分组
  2. 版本管理

    • 使用版本前缀区分 API 版本
    • 保持向后兼容
    • 标记废弃的接口
  3. 安全考虑
    • 生产环境关闭自动生成
    • 限制文档访问权限
    • 不暴露敏感信息

🐛 问题排查

  1. 文档不更新

    • 清除缓存:php bin/hyperf.php swagger:clear
    • 检查自动生成是否开启
    • 手动生成:php bin/hyperf.php swagger:generate
  2. 接口未显示

    • 确认控制器有 @ApiController 注解
    • 检查扫描路径配置
    • 验证注解语法正确
  3. 参数信息缺失
    • 确认 Validate 组件已安装
    • 检查验证规则格式
    • 查看生成的 JSON 文件

🛠️ 命令行工具

📄 许可证

MIT License

🤝 贡献

欢迎提交 Issue 和 Pull Request!

🔗 相关链接


All versions of swagger with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
hyperf-plus/route Version ^3.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hyperf-plus/swagger contains the following files

Loading the files please wait ....