mijohansen / slim-swagger
Simpler way to hook a swagger api into slim-framework.
0.0.5
2018-11-24 17:35 UTC
Requires
- php: >=7.0
- ext-json: *
- composer/spdx-licenses: ^1.4
- doctrine/annotations: 1.4
- eloquent/composer-config-reader: ^2.1
- myclabs/deep-copy: 1.7
- psx/model: ^2.0
- psx/schema: ^2.4
- slim/slim: ^3.10
- symfony/console: ^3.4
Requires (Dev)
- phpunit/phpunit: ^4.8
- vierbergenlars/php-semver: dev-master
This package is auto-updated.
Last update: 2025-03-01 00:24:50 UTC
README
Slim needs a simpler way to define an Swagger API. No docblock magic, just code.
This project is at an early stage. Functionality will break.
Usage
Adding the dependencies to the container
You need to override the router and add the swagger liberary to Slim. A clean way of doing this is BEFORE the $app object is initiated.
Minimal example:
use Slim\App; use SlimSwagger\SlimSwagger; $container = SlimSwagger::init(); $app = new App($container);
Installing the swagger route:
use SlimSwagger\SwaggerAction; $app->get('/swagger.json', SwaggerAction::class);