cline/openapi 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cline/openapi

Composer 安装命令:

composer require cline/openapi

包简介

Standalone OpenAPI document builder for explicit PHP specifications.

README 文档

README

GitHub Workflow Status Latest Version on Packagist Software License Total Downloads

OpenApi

Standalone OpenAPI 3.1 document builder for explicit PHP specifications, with optional Laravel route binding and Artisan generation support.

Requirements

Requires PHP 8.5+

Installation

composer require cline/openapi

Optional Laravel integration:

composer require laravel/framework

Features

  • Contract-first authoring: Define documents explicitly in PHP instead of relying on inferred annotations or reflection-heavy generation
  • Standalone core: No Laravel or framework dependency
  • Optional Laravel adapter: Bind endpoint specs to named Laravel routes, validate controller request handlers, scaffold explicit endpoint classes from real routes, and generate documents with php artisan openapi:generate
  • Versioned documents: Build one explicit OpenAPI document per API version
  • Typed builders: Use fluent builders for info, servers, operations, parameters, schemas, callbacks, links, request bodies, responses, and more
  • Reusable components: Register schemas, parameters, request bodies, responses, callbacks, examples, and links as named components
  • Reusable resource contracts: Define model-like API shapes once and emit related collection or JSON:API wrapper schemas from a single resource spec
  • Common API helpers: Build pagination, relationship, and filter or sort parameter contracts from dedicated helpers instead of ad-hoc arrays
  • JSON:API helpers: Generate JSON:API collection contracts without coupling the core package to a framework
  • Escape hatches: Use merge(...), component(...), and extension(...) when you need unusual OpenAPI shapes
  • Built-in validation: Detect duplicate operationId values and unresolved component references during generation, plus structural document drift like missing responses, invalid paths, and missing path parameters

Documentation

  • DOCS.md - Full in-depth usage guide
  • Includes standalone usage and optional Laravel integration
  • Includes the explicit Laravel scaffold workflow for large APIs

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.

Credits

License

The MIT License. Please see License File for more information.

统计信息

  • 总下载量: 1.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固