Added swager docs

This commit is contained in:
2026-04-02 22:55:01 +02:00
parent 6e7aa21c40
commit 59fb96cc26
9 changed files with 2991 additions and 21 deletions
+15 -15
View File
@@ -60,7 +60,7 @@ func validateCustomHeaders(customHeaders *models.CustomHeaders) error {
//
// @Summary List forward rules for a site
// @Description Returns all forward rules associated with the given site
// @Tags forward-rules
// @Tags Forward-Rules
// @Produce json
// @Param id path string true "Site ID"
// @Success 200 {array} models.ForwardRule "List of forward rules"
@@ -89,7 +89,7 @@ func (h *SiteHandler) GetSiteForwardRules(c fiber.Ctx) error {
//
// @Summary Get a forward rule
// @Description Returns a single forward rule by ID
// @Tags forward-rules
// @Tags Forward-Rules
// @Produce json
// @Param id path string true "Forward Rule ID"
// @Success 200 {object} models.ForwardRule "Forward rule"
@@ -115,7 +115,7 @@ func (h *SiteHandler) GetForwardRule(c fiber.Ctx) error {
//
// @Summary Create a forward rule
// @Description Creates a new forward rule for the given site
// @Tags forward-rules
// @Tags Forward-Rules
// @Accept json
// @Produce json
// @Param id path string true "Site ID"
@@ -158,7 +158,7 @@ func (h *SiteHandler) PostForwardRule(c fiber.Ctx) error {
//
// @Summary Update a forward rule
// @Description Replaces an existing forward rule by ID
// @Tags forward-rules
// @Tags Forward-Rules
// @Accept json
// @Produce json
// @Param id path string true "Forward Rule ID"
@@ -208,7 +208,7 @@ func (h *SiteHandler) PutForwardRule(c fiber.Ctx) error {
//
// @Summary Delete a forward rule
// @Description Deletes a forward rule by ID
// @Tags forward-rules
// @Tags Forward-Rules
// @Produce json
// @Param id path string true "Forward Rule ID"
// @Success 204 "No content"
@@ -238,7 +238,7 @@ func (h *SiteHandler) DeleteForwardRule(c fiber.Ctx) error {
//
// @Summary List custom header groups for a site
// @Description Returns all custom header groups associated with the given site
// @Tags custom-headers
// @Tags Custom-Headers
// @Produce json
// @Param id path string true "Site ID"
// @Success 200 {array} models.CustomHeaders "List of custom header groups"
@@ -267,7 +267,7 @@ func (h *SiteHandler) GetSiteCustomHeaders(c fiber.Ctx) error {
//
// @Summary Get a custom header group
// @Description Returns a single custom header group by ID
// @Tags custom-headers
// @Tags Custom-Headers
// @Produce json
// @Param id path string true "Custom Headers ID"
// @Success 200 {object} models.CustomHeaders "Custom header group"
@@ -293,7 +293,7 @@ func (h *SiteHandler) GetCustomHeaders(c fiber.Ctx) error {
//
// @Summary Create a custom header group
// @Description Creates a new custom header group for the given site
// @Tags custom-headers
// @Tags Custom-Headers
// @Accept json
// @Produce json
// @Param id path string true "Site ID"
@@ -336,7 +336,7 @@ func (h *SiteHandler) PostCustomHeaders(c fiber.Ctx) error {
//
// @Summary Update a custom header group
// @Description Replaces an existing custom header group by ID
// @Tags custom-headers
// @Tags Custom-Headers
// @Accept json
// @Produce json
// @Param id path string true "Custom Headers ID"
@@ -386,7 +386,7 @@ func (h *SiteHandler) PutCustomHeaders(c fiber.Ctx) error {
//
// @Summary Delete a custom header group
// @Description Deletes a custom header group by ID
// @Tags custom-headers
// @Tags Custom-Headers
// @Produce json
// @Param id path string true "Custom Headers ID"
// @Success 204 "No content"
@@ -416,7 +416,7 @@ func (h *SiteHandler) DeleteCustomHeaders(c fiber.Ctx) error {
//
// @Summary List headers in a custom header group
// @Description Returns all individual headers belonging to the given custom header group
// @Tags custom-headers
// @Tags Custom-Headers
// @Produce json
// @Param id path string true "Custom Headers ID"
// @Success 200 {array} models.Header "List of headers"
@@ -445,7 +445,7 @@ func (h *SiteHandler) GetCustomHeaderHeaders(c fiber.Ctx) error {
//
// @Summary Get a header
// @Description Returns a single header by ID
// @Tags headers
// @Tags Headers
// @Produce json
// @Param id path string true "Header ID"
// @Success 200 {object} models.Header "Header"
@@ -471,7 +471,7 @@ func (h *SiteHandler) GetHeader(c fiber.Ctx) error {
//
// @Summary Create a header
// @Description Creates a new header within the given custom header group
// @Tags headers
// @Tags Headers
// @Accept json
// @Produce json
// @Param id path string true "Custom Headers ID"
@@ -514,7 +514,7 @@ func (h *SiteHandler) PostHeader(c fiber.Ctx) error {
//
// @Summary Update a header
// @Description Replaces an existing header by ID
// @Tags headers
// @Tags Headers
// @Accept json
// @Produce json
// @Param id path string true "Header ID"
@@ -564,7 +564,7 @@ func (h *SiteHandler) PutHeader(c fiber.Ctx) error {
//
// @Summary Delete a header
// @Description Deletes a header by ID
// @Tags headers
// @Tags Headers
// @Produce json
// @Param id path string true "Header ID"
// @Success 204 "No content"
+1 -1
View File
@@ -18,7 +18,7 @@ func Register(app *fiber.App, cfg *config.Config, envCfg *envconfig.EnvConfig, d
updateSiteHandler := handlers.NewUpdateSiteHandler(cfg, envCfg)
siteHandler := handlers.NewSiteHandler(siteRepository)
api := app.Group("/api")
api := app.Group("/api/v1")
api.Get("/health", handlers.HealthCheck)
api.Post("/update", updateSiteHandler.PostUpdate)