-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
- Provide clear, user-friendly API docs for existing and upcoming endpoints. Add an OpenAPI 3.0 spec and serve Swagger UI from the app for quick exploration.
Current Endpoints (from internal/api/router.go)
POST /discover— same as/api/discover(duplicate for compatibility?)POST /api/discover— ingest server metadata and return stored idGET /api/servers— list all serversGET /api/servers/{id}— get server by id- UI:
GET /andGET /server/{id}(HTML)
Deliverables
openapi.yaml(checked into repo) describing all public endpoints, schemas, and errors.- Serve Swagger UI at
/api/docs(read-only; no auth initially) that loads the spec. - README section "API" with quickstart and example curl requests.
- Handler godoc comments updated to reflect behavior, errors, and status codes.
- As new app-grouping endpoints land, extend the spec accordingly.
Details
- Schemas to document:
Metadata(request body for discovery; response shape for servers)- Error responses with fields
{ error: string }where applicable
- Status codes and semantics:
400for invalid JSON/validation failures404for not found409for uniqueness conflicts (e.g., future appidentifierduplicates)500for storage errors
Tasks
- Draft
openapi.yamlfor current endpoints. - Add a small
/api/docshandler that serves Swagger UI (static assets) and the spec. - Update README with API examples for existing endpoints.
- Ensure handler comments align with docs (source of truth remains the code + spec).
- Extend docs when app grouping feature lands (see related issue).
Notes
- Consider adding a versioned base path (e.g.,
/api/v1) when introducing breaking changes. - If
/discoverand/api/discoverare intended to be identical, document both; if not, clarify behavior or deprecate one.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request