Summary
Include SwaggerBake as a dev dependency with base configuration for automatic OpenAPI documentation generation.
Changes
- Add
config/swagger_bake.php -- plugin config pointing to the API route prefix
- Add
config/swagger.yml -- base OpenAPI 3.0 spec skeleton with info section, server URLs, and a reusable Exception schema
- Load plugin in development mode in
Application.php
- Swagger UI available at a dev-only route (e.g.,
/api/swagger)
New dependency (dev)
cnizzardini/cakephp-swagger-bake
Motivation
SwaggerBake auto-generates OpenAPI paths from CakePHP routes, entity schemas from table columns, and supports PHP 8 attributes for customization. Interactive API docs out of the box with minimal configuration.
Summary
Include SwaggerBake as a dev dependency with base configuration for automatic OpenAPI documentation generation.
Changes
config/swagger_bake.php-- plugin config pointing to the API route prefixconfig/swagger.yml-- base OpenAPI 3.0 spec skeleton with info section, server URLs, and a reusableExceptionschemaApplication.php/api/swagger)New dependency (dev)
cnizzardini/cakephp-swagger-bakeMotivation
SwaggerBake auto-generates OpenAPI paths from CakePHP routes, entity schemas from table columns, and supports PHP 8 attributes for customization. Interactive API docs out of the box with minimal configuration.