Skip to content

feat: Add public API docs#1907

Merged
kristiankunc merged 2 commits into
mainfrom
api-docs
May 31, 2026
Merged

feat: Add public API docs#1907
kristiankunc merged 2 commits into
mainfrom
api-docs

Conversation

@kristiankunc

@kristiankunc kristiankunc commented May 30, 2026

Copy link
Copy Markdown
Contributor
  • Adds Swagger api docs at /api/documentation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/documentation and serve the OpenAPI YAML from /api/documentation/openapi.yaml.
  • Add swagger-ui-dist frontend dependency and Vite entrypoint for the docs UI.
  • Introduce a new api rate limiter and apply throttle:api to the existing public API 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.

Comment thread app/Providers/AppServiceProvider.php Outdated
Comment thread docs/openapi.yaml
Comment thread docs/openapi.yaml
Comment thread app/Providers/Filament/AdminPanelProvider.php
Comment thread tests/app/Http/Controllers/ApiDocumentationControllerTest.php Outdated
@sonarqubecloud

Copy link
Copy Markdown

@kristiankunc kristiankunc force-pushed the api-docs branch 3 times, most recently from bf8dfc8 to a7822a7 Compare May 31, 2026 11:07
@sonarqubecloud

Copy link
Copy Markdown

@kristiankunc kristiankunc merged commit 4b72080 into main May 31, 2026
4 checks passed
@kristiankunc kristiankunc deleted the api-docs branch May 31, 2026 11:13
@VATSIMUK

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.66.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants