Skip to content

Latest commit

 

History

History
74 lines (50 loc) · 2.06 KB

README.md

File metadata and controls

74 lines (50 loc) · 2.06 KB

cake-swagger

License

CakePHP 4.x plugin that dinamically adds auto-generated Swagger documentation to your projects using swagger-php and swagger-ui 3.x

Requirements

Installation

  1. Install the plugin using composer:

    composer require devin345458/cake-swagger:dev-master
  2. To enable the plugin either run the following command:

    bin/cake plugin load CakeSwagger

    or manually add the following line to your config/bootstrap.php file:

    Application::load('CakeSwagger');
  3. Create the configuration file /config/cake-swagger.php if not exists. See #Configuration section

  4. Browsing to http://your_app_uri/api/ui should now produce the Swagger-UI interface:

    Default UI index

Configuration

All configuration for this plugin is done through the /config/cake-swagger.php configuration file. Full example below.

<?php

return [
	'CakeSwagger' => [
		'ui' => [
			'title' => 'CakePHP Swagger plugin'
		],
		'route' => [
			'path' => '/api'
		],
		'directory' => [],
		'exclude' => []
	]
];

Additional Reading

Contribute

I'm trying to make this plugin very testable for the community. Your ideas and suggestions are welcome. Create an issue here.

NB

This plugin was originally forked from alt3/cakephp-swagger based on the Swagger-UI 2.2.3