Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mako-framework/open-api
Generate routes based on OpenAPI specifications and OpenAPI specifications from code.
https://github.com/mako-framework/open-api
mako-framework mako-package openapi redoc swagger swagger-ui
Last synced: about 1 month ago
JSON representation
Generate routes based on OpenAPI specifications and OpenAPI specifications from code.
- Host: GitHub
- URL: https://github.com/mako-framework/open-api
- Owner: mako-framework
- License: bsd-3-clause
- Created: 2020-10-22T18:00:20.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-31T11:32:45.000Z (6 months ago)
- Last Synced: 2024-09-30T15:13:07.816Z (about 2 months ago)
- Topics: mako-framework, mako-package, openapi, redoc, swagger, swagger-ui
- Language: PHP
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenApi
[![Static analysis](https://github.com/mako-framework/open-api/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/mako-framework/open-api/actions/workflows/static-analysis.yml)
The `mako/open-api` package allows you to generate a [OpenApi](https://www.openapis.org) specification using [attributes](https://www.php.net/manual/en/language.attributes.php) or docblock annotations and to generate routes based on the specification.
## Requirements
Mako 10.0 or greater.
## Installation
First you'll need to install the package as a dependency to your project.
```
composer require mako/open-api
```Next you'll need to add the package to the `cli` section of the `packages` configuration array in the `application.php` config file.
```
'cli' =>
[
mako\openapi\OpenApiPackage::class,
]
```And finally replace the contents of your `routes.php` file with the following:
```php
Note that you have to set the `operationId` parameter to the fully qualified method name (e.g. app\controllers\Index::welcome) of your controller action for the route generator to work.```
openapi: 3.0.2
info:
title: Mako
version: 1.0.0
description: Mako example application.
paths:
'/':
summary: Displays a welcome page.
get:
operationId: 'app\controllers\Index::welcome'
```