cline / openapi
Standalone OpenAPI document builder for explicit PHP specifications.
1.2.0
2026-04-04 06:15 UTC
Requires
- php: ^8.5.0
Requires (Dev)
- cline/coding-standard: ^3.3.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.4.3
- pestphp/pest-plugin-laravel: ^4.0.0
- pestphp/pest-plugin-type-coverage: ^4.0.3
- phpstan/phpstan: ^2.1.45
- rector/rector: ^2.3.9
- symfony/var-dumper: ^7.4.0 || ^8.0
Suggests
- laravel/framework: Required to use the optional Laravel route discovery, validation, and artisan generator integration.
README
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
- JSON:API helpers: Generate JSON:API collection contracts without coupling the core package to a framework
- Escape hatches: Use
merge(...),component(...), andextension(...)when you need unusual OpenAPI shapes - Built-in validation: Detect duplicate
operationIdvalues and unresolved component references during generation
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.