kleijnweb/swagger-bundle
Unmaintained Symfony bundle for contract-first REST APIs using OpenAPI/Swagger. Generates routing from specs, validates requests, and transforms input/output with minimal config and no FOSRestBundle/Twig. Includes security integration; 4.0 beta targets PHP 7.
Pros:
laravel/sanctum, fruitcake/laravel-cors) if used in a Symfony-adjacent or hybrid stack.Cons:
routes/web.php, routes/api.php) and validation systems (e.g., Form Requests, API Resources) are fundamentally different.darkaonline/l5-swagger or zircote/swagger-php).RoutingLoader, Validator integration) for Laravel is non-trivial.openapi/php) are more maintainable.sensio/framework-extra-bundle), which are deprecated.darkaonline/l5-swagger (Laravel 5.x, but outdated)zircote/swagger-php (OpenAPI generator for PHP)filp/whoops + manual OpenAPI docsRoutingLoader with Laravel’s RouteServiceProvider.Validator integration to Laravel’s Illuminate\Validation.EventDispatcher vs. Laravel’s Pipeline).| Step | Action | Risk | Laravel Workaround |
|---|---|---|---|
| 1 | Assess Compatibility | High | Check if Symfony 2/3 components can be polyfilled (e.g., via symfony/console bridge). |
| 2 | Generate OpenAPI Spec | Low | Use zircote/swagger-php to generate OpenAPI 3.x from Laravel routes. |
| 3 | Replace Routing Logic | Critical | Manually map OpenAPI paths to Laravel routes in RouteServiceProvider. |
| 4 | Implement Validation | Medium | Use Laravel’s FormRequest or Validator facade with OpenAPI schemas. |
| 5 | Test Middleware | High | Rewrite Symfony middleware (e.g., Hateoas, NelmioApiDoc) for Laravel. |
zircote/swagger-php to generate OpenAPI 3.x from existing Laravel routes.darkaonline/l5-swagger (if Laravel 5.x) or bobbyr/swagger for UI.RouteServiceProvider::boot().Validator::extend() to add OpenAPI schema validation.EventDispatcher) with Laravel’s Events or Middleware.zircote/swagger-php (actively maintained, OpenAPI 3.x).openapi-tools/openapi-generator (for codegen).RoutingLoader is not optimized for Laravel’s router (e.g., FastRoute).| Scenario | Impact | Mitigation |
|---|---|---|
| PHP 8.x Incompatibility | Breaks on upgrade | Use Dockerized Symfony 2/3 environment (not sustainable). |
| Route Conflicts | Overwrites Laravel routes | Implement route prefix isolation. |
| Validation Errors | False positives/negatives | Test against postman/insomnia collections. |
| Middleware Failures | Broken API responses | Mock Symfony middleware in tests. |
| Abandoned Package | No future updates | Plan for migration to modern OpenAPI tools. |
RoutingLoader, Validator, and EventDispatcher.How can I help you explore Laravel packages today?