/cakephp-swagger-bake-demo

Demo application for SwaggerBake

Primary LanguagePHPOtherNOASSERTION

Swagger Bake Demo Application

Note: I have forked this repository to test whether it is possible to add OpenAPI validation rule annotations programmatically.

This is possible - see SwaggerBakeListener.php in the validation-test branch for an example.

Demo Site | Project Home

Submit problems or requests for additional examples as github issues.

Installation

Clone repository:

git clone git@github.com:cnizzardini/cakephp-swagger-bake-demo.git

Install via composer:

composer install

Configure the application for database access using config/.env or config/app_local.php, then run migrations to build/seed your database.

bin/cake migrations migrate -p Sakila
bin/cake migrations seed -p Sakila

Configure your web server or run the cake web server:

bin/cake server

That's it, you're done!

Examples

Here is a list of some examples. It's best to search src/ for an exhaustive list of examples.

Feature Example
SwaggerBake Events App\Event\SwaggerBakeListener
OpenApiDto App\Controller\ExamplesControllers
OpenApiForm App\Controller\ExamplesController::formExample
OpenApiHeader App\Controller\ExamplesController::headerExample
OpenApiOperation App\Controller\ActorsController::index
OpenApiPaginator Most controller index() actions have this defined
OpenApiPath
OpenApiPathParam
OpenApiQueryParam App\Controller\ExamplesController::headerExample
OpenApiRequestBody
OpenApiResponse App\Controller\CountriesController
OpenApiResponse associations App\Controller\ActorsController::films
OpenApiResponse schema App\Controller\ExamplesControllers
OpenApiSchema App\Model\Entity\Rental
OpenApiSchemaProperty
OpenApiSearch FilmsController::index
OpenApiSecurity