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

ActiveLibrary[API Development](/categories/api)

monkeyscloud/monkeyslegion-openapi
==================================

Automatic OpenAPI 3.1 specification generator and Swagger UI middleware for the MonkeysLegion framework.

1.0.0(2mo ago)0170↓78.1%3MITPHPPHP ^8.4

Since Apr 10Pushed 1mo agoCompare

[ Source](https://github.com/MonkeysCloud/MonkeysLegion-OpenApi)[ Packagist](https://packagist.org/packages/monkeyscloud/monkeyslegion-openapi)[ RSS](/packages/monkeyscloud-monkeyslegion-openapi/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (3)

MonkeysLegion OpenAPI
=====================

[](#monkeyslegion-openapi)

Automatic **OpenAPI 3.1** specification generator and documentation middleware for the [MonkeysLegion](https://github.com/MonkeysCloud) framework.

Generate a complete API specification from your route definitions and PHP 8.4 attributes — zero manual YAML/JSON editing required.

---

Features
--------

[](#features)

FeatureDescription**Attribute-driven**Annotate controllers with `#[ApiParam]`, `#[ApiResponse]`, `#[RequestBody]`, `#[ApiSecurity]`, `#[ApiDeprecated]`, `#[ApiHidden]`**Auto parameter detection**Path parameters like `{id}` are automatically documented**Security schemes**Bearer JWT, API key, OAuth2 — configurable per-controller or per-method**Multiple responses**Document 200, 404, 422, etc. with schemas per endpoint**Request body schemas**Inline JSON Schema or `$ref` to DTO classes**Swagger UI + ReDoc**Built-in middleware serves either documentation UI**Dark mode**Optional dark theme for Swagger UI**Caching**Spec is cached after first build; invalidate on demand**YAML export**`toYaml()` when `ext-yaml` is available**Enable/disable**Toggle docs off in production with a single flag---

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

[](#installation)

```
composer require monkeyscloud/monkeyslegion-openapi
```

### Requirements

[](#requirements)

- PHP 8.4+
- `monkeyscloud/monkeyslegion-router` ^2.0
- `monkeyscloud/monkeyslegion-http` ^2.0

---

Quick Start
-----------

[](#quick-start)

### 1. Annotate your controller

[](#1-annotate-your-controller)

```
