feat(PROJ-13): OpenAPI 3.0 Spec + GET /api/v1/docs Endpoint

Serves the static OpenAPI YAML via go:embed. Completes the last
open acceptance criterion for PROJ-13. PROJ-44 marked Deployed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sysops
2026-05-29 18:03:58 +02:00
parent fa9f77782c
commit 15a5da33fd
5 changed files with 456 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
package api
import (
_ "embed"
"net/http"
)
//go:embed openapi.yaml
var openapiSpec []byte
// handleV1Docs serves the OpenAPI 3.0 spec for the external REST API.
// GET /api/v1/docs
func (s *Server) handleV1Docs(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/yaml; charset=utf-8")
w.WriteHeader(http.StatusOK)
w.Write(openapiSpec)
}