PHPackages                             cstaf/cakephp-swagger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cstaf/cakephp-swagger

ActiveCakephp-plugin[API Development](/categories/api)

cstaf/cakephp-swagger
=====================

Instant Swagger documentation for your CakePHP 5.x APIs

5.3.0(3mo ago)0243↓50%MITJavaScriptPHP &gt;=7.0

Since Sep 7Pushed 3mo agoCompare

[ Source](https://github.com/joaopatrocinio/cakephp-swagger)[ Packagist](https://packagist.org/packages/cstaf/cakephp-swagger)[ RSS](/packages/cstaf-cakephp-swagger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (15)Used By (0)

cakephp-swagger
===============

[](#cakephp-swagger)

CakePHP 5.x plugin that adds auto-generated Swagger 2.0 documentation to your projects using swagger-php and swagger-ui.

Requirements
------------

[](#requirements)

- CakePHP 5.0+
- Some [swagger-php](https://github.com/zircote/swagger-php) annotation knowledge

Installation
------------

[](#installation)

Install the plugin using composer:

```
composer require cstaf/cakephp-swagger
```

Enabling
--------

[](#enabling)

Enable the plugin in the `bootstrap()` method found in `src/Application.php`:

```
    public function bootstrap()
    {
        parent::bootstrap();
        $this->addPlugin('Cstaf/Swagger');
    }
```

> Also make sure that AssetMiddleware is loaded inside `Application.php` or all Swagger page assets will 404.

Installation check
------------------

[](#installation-check)

After enabling the plugin, browsing to `http://your.app/swagger` should now produce the [Swagger-UI](http://swagger.io/swagger-ui/) interface:

[![Default UI index](/docs/images/ui-index-default.png)](/docs/images/ui-index-default.png)

Configuration
-------------

[](#configuration)

All configuration for this plugin is done through the `/config/swagger.php`configuration file. TLDR full example below.

```
