ez-php / swagger-ui
Serves Swagger UI / ReDoc documentation for the OpenAPI spec produced by ez-php/openapi
2.4.0
2026-09-14 23:33 UTC
Requires
- php: ^8.5
- ez-php/contracts: ^2.0
- ez-php/framework: ^2.0
- ez-php/http: ^2.0
Requires (Dev)
- ez-php/docker: ^2.0
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Serves Swagger UI / ReDoc documentation for the OpenAPI spec produced by ez-php/openapi
Installation
composer require ez-php/swagger-ui
Usage
Register the service provider (typically in provider/modules.php):
$app->register(\EzPhp\SwaggerUI\SwaggerUiServiceProvider::class);
This registers GET /docs, rendering a Swagger UI page that fetches its spec
from GET /openapi.json (see ez-php/openapi). Configure via config/swagger-ui.php
or environment:
return [ 'endpoint' => env('SWAGGER_UI_ENDPOINT', '/docs'), 'spec_url' => env('SWAGGER_UI_SPEC_URL', '/openapi.json'), 'renderer' => env('SWAGGER_UI_RENDERER', 'swagger-ui'), // or 'redoc' ];
Both renderers load their assets from a CDN (jsDelivr) — nothing is vendored
by this module. Apply authentication or rate limiting to the /docs route in
your own application's service provider if the documentation should not be
publicly accessible.
License
MIT