15a5da33fd
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>
18 lines
380 B
Go
18 lines
380 B
Go
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)
|
|
}
|