PHPackages                             cline/openapi - 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. cline/openapi

ActiveLibrary[API Development](/categories/api)

cline/openapi
=============

Standalone OpenAPI document builder for explicit PHP specifications.

1.5.0(yesterday)029↑2900%MITPHPPHP ^8.5.0CI passing

Since Apr 4Pushed yesterdayCompare

[ Source](https://github.com/faustbrian/openapi)[ Packagist](https://packagist.org/packages/cline/openapi)[ RSS](/packages/cline-openapi/feed)WikiDiscussions main Synced today

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

[![GitHub Workflow Status](https://github.com/faustbrian/openapi/actions/workflows/quality-assurance.yaml/badge.svg)](https://github.com/faustbrian/openapi/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/ab3c138593c9266520c4234f66c94463dde9826249f61c0354b8cb5db99ac733/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f6f70656e6170692e737667)](https://packagist.org/packages/cline/openapi)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/6a345008c180f0a9b563ddf9c705daa6a760c8052d2efa4979dce84dc5b94c93/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f6f70656e6170692e737667)](https://packagist.org/packages/cline/openapi)

---

OpenApi
=======

[](#openapi)

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

Requirements
------------

[](#requirements)

> **Requires [PHP 8.5+](https://php.net/releases/)**

Installation
------------

[](#installation)

```
composer require cline/openapi
```

Optional Laravel integration:

```
composer require laravel/framework
```

Features
--------

[](#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
-------------

[](#documentation)

- [DOCS.md](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
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md)for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/faustbrian/openapi/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://github.com/faustbrian)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance100

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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 ~0 days

Total

6

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (10 commits)")

---

Tags

phpschemaopenapi

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cline-openapi/health.svg)

```
[![Health](https://phpackages.com/badges/cline-openapi/health.svg)](https://phpackages.com/packages/cline-openapi)
```

###  Alternatives

[harmbandstra/swagger-ui-bundle

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

42867.3k](/packages/harmbandstra-swagger-ui-bundle)[uderline/openapi-php-attributes

Automatically render your OpenApi 3 file describing your PHP API using attributes

2136.3k](/packages/uderline-openapi-php-attributes)

PHPackages © 2026

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