package api import ( _ "embed" "net/http" ) //go:embed openapi.yaml var openAPISpec []byte // handleOpenAPISpec serves the raw OpenAPI document. func (s *Server) handleOpenAPISpec(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/yaml") _, _ = w.Write(openAPISpec) } // docsHTML is a self-contained API docs viewer. It loads Redoc from a CDN when // online, but falls back to a readable, dependency-free rendering of // /openapi.yaml so the page works air-gapped too. const docsHTML = ` Matrix Runtime API — Docs

Matrix Runtime API

openapi openapi.yaml ↗

Rendering API reference…

` // handleDocs serves the API docs viewer. func (s *Server) handleDocs(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") _, _ = w.Write([]byte(docsHTML)) }