Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dermanomann/openapi-router

Routing adapter bridge for ApenAPI annotations.
https://github.com/dermanomann/openapi-router

annotation hacktoberfest laravel lumen openapi openapi-router router silex slim

Last synced: 18 days ago
JSON representation

Routing adapter bridge for ApenAPI annotations.

Awesome Lists containing this project

README

        

# openapi-router

[![Build Status](https://github.com/DerManoMann/openapi-router/workflows/build/badge.svg)](https://github.com/DerManoMann/openapi-router/actions)
[![Coverage Status](https://coveralls.io/repos/github/DerManoMann/openapi-router/badge.svg)](https://coveralls.io/github/DerManoMann/openapi-router)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Introduction
Allows to (re-)use [Swagger-PHP](https://github.com/zircote/swagger-php) annotations 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
* [PHP 7.2 or higher](http://www.php.net/) - depending on framework version.

## 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:

```sh
composer require radebatz/openapi-router
```
After that all required classes should be availabe in your project to add routing support.

## Basic usage

Example using the `Slim` framework adapter and standard [OpenApi annotations](https://github.com/zircote/swagger-php/tree/master/src/Annotations) only.

**index.php**
```php
registerRoutes();

$app->run();
```

**Controller**
```php
write('Get me');
}
}
```

## Documentation
* [Configuration](docs/Configuration.md)
* [Annotation extensions](docs/AnnotationExtensions.md)

## License

The openapi-router project is released under the [MIT license](LICENSE).