package general import ( "git.ma-al.com/goc_marek/timetracker/app/api" "github.com/gofiber/fiber/v3" "github.com/gofiber/fiber/v3/middleware/static" ) func InitSwagger(app *fiber.App) { // Swagger - serve OpenAPI JSON app.Get("/openapi.json", func(c fiber.Ctx) error { c.Set("Content-Type", "application/json") return c.SendString(api.ApenapiJson) }) // Swagger UI HTML app.Get("/swagger", func(c fiber.Ctx) error { return c.Redirect().Status(fiber.StatusFound).To("/swagger/index.html") }) app.Get("/swagger/index.html", func(c fiber.Ctx) error { c.Set("Content-Type", "text/html") return c.SendString(swaggerHTML) }) // Serve Swagger assets app.Get("/swagger/assets", static.New("app/api/swagger/assets")) } // Embedded Swagger UI HTML (minimal version) var swaggerHTML = `