Skip to content

OpenApi(Swagger) 3.0 package for Lumen 5.5+ and Laravel 5.5+ with REDOC UI and SwaggerUI 3

License

Notifications You must be signed in to change notification settings

noitran/opendox

Repository files navigation

Opendox - OpenAPI 3.0 (Swagger 3) package for Lumen and Laravel

Coverage Status Quality Score Software License Latest Version Total Downloads

About

This package will add console command to lumen/laravel which will parse yml file, convert it into json and save to public path. Redoc UI is connected and Swagger UI are connected and can be accessed to view generated documentation. Also package adds route for raw json documentation output, so this package can be used in microservice architecture, where all your microservices expose list of available routes.

Features

  • Adds console command php artisan opendox:transform to transform OpenApi 3.0 specification yaml files to json, so it can be accessible for external services
  • Adds /api/documentation route where you can access Redoc UI interface of documentation
  • Adds /api/console route where you can access Swagger UI interface for API docs and interaction
  • Adds /docs route where RAW json can be accessed

Install

  • Install as composer package
$ composer require noitran/opendox

Laravel

  • Laravel uses provider auto discovery. Config file can be published using command
$ php artisan vendor:publish --provider="Noitran\Opendox\ServiceProvider"

Lumen

  • Open your bootstrap/app.php and register as service provider
$app->register(Noitran\Opendox\ServiceProvider::class);
  • Config file should be loaded manually in bootstrap/app.php
$app->configure('opendox');

Usage

  • In your application project /src folder create api-docs.yml file. Write your documentation using OpenAPI standard

Example