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

ActiveLibrary[API Development](/categories/api)

radebatz/openapi-router
=======================

Routing adapter for OpenApi annotations.

3.2.0(2mo ago)74.1k—6.3%1[1 issues](https://github.com/DerManoMann/openapi-router/issues)MITPHPPHP &gt;=8.2CI passing

Since Jun 24Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/DerManoMann/openapi-router)[ Packagist](https://packagist.org/packages/radebatz/openapi-router)[ Docs](http://radebatz.net/mano/)[ RSS](/packages/radebatz-openapi-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (25)Versions (13)Used By (0)

openapi-router
==============

[](#openapi-router)

[![Build Status](https://github.com/DerManoMann/openapi-router/workflows/build/badge.svg)](https://github.com/DerManoMann/openapi-router/actions)[![Coverage Status](https://camo.githubusercontent.com/27064f33d3085d9985f7c768acf309b12b1ccdd08368e410e0947c84dbd7f550/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4465724d616e6f4d616e6e2f6f70656e6170692d726f757465722f62616467652e737667)](https://coveralls.io/github/DerManoMann/openapi-router)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Introduction
------------

[](#introduction)

Allows to (re-)use [Swagger-PHP](https://github.com/zircote/swagger-php) attributes (docblock annotations are deprecated), to configure routes in the following frameworks:

- [Laravel](https://github.com/laravel/laravel)
- [Lumen](https://github.com/laravel/lumen)
- [Slim](https://github.com/slimphp/Slim)

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

[](#requirements)

- [PHP 8.1 or higher](http://www.php.net/) - depending on framework version.

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

[](#installation)

You can use **composer** or simply **download the release**.

**Composer**

The preferred method is via [composer](https://getcomposer.org). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

```
composer require radebatz/openapi-router
```

After that all required classes should be availabe in your project to add routing support.

Basic usage
-----------

[](#basic-usage)

Example using the `Slim` framework adapter and standard [OpenApi attributes](https://zircote.github.io/swagger-php/guide/attributes) only.

**Controller**

```
