feat: Add public API docs#1907
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a public Swagger UI page and OpenAPI spec for the unauthenticated (“public”) API surface, and introduces a 60 req/min throttle intended for public endpoints.
Changes:
- Add Swagger UI at
/api/documentationand serve the OpenAPI YAML from/api/documentation/openapi.yaml. - Add
swagger-ui-distfrontend dependency and Vite entrypoint for the docs UI. - Introduce a new
apirate limiter and applythrottle:apito the existingpublicAPI route group.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Locks new frontend dependency transitive packages for Swagger UI. |
| package.json | Adds swagger-ui-dist dependency. |
| vite.config.js | Adds resources/js/swagger-ui.js as a Vite build input. |
| resources/js/swagger-ui.js | Initializes Swagger UI and loads the OpenAPI YAML from the new endpoint. |
| resources/views/api-documentation.blade.php | Adds the Swagger UI HTML shell and Vite asset include. |
| routes/web.php | Adds web routes for /api/documentation and /api/documentation/openapi.yaml. |
| docs/openapi.yaml | Adds the OpenAPI 3.0 definition for public endpoints. |
| app/Providers/AppServiceProvider.php | Registers the new api rate limiter (60/min). |
| app/Http/Middleware/MiddlewareKeys.php | Adds a THROTTLE middleware key constant. |
| app/Http/Kernel.php | Registers the throttle middleware alias and applies it to the public middleware group. |
| app/Providers/Filament/AdminPanelProvider.php | Adds a Filament nav link to API docs. |
| tests/app/Http/Controllers/ApiDocumentationControllerTest.php | Adds tests for the docs page, OpenAPI YAML endpoint, and rate-limit headers behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
bf8dfc8 to
a7822a7
Compare
|
|
🎉 This PR is included in version 6.66.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



/api/documentation