Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ config.yaml
tmp/
temp/
.tmp/
/genspec
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.41.0
golang.org/x/crypto v0.51.0
golang.org/x/oauth2 v0.36.0
golang.org/x/tools v0.45.0
gopkg.in/yaml.v3 v3.0.1
modernc.org/sqlite v1.47.0
)
Expand Down Expand Up @@ -201,6 +202,7 @@ require (
go.yaml.in/yaml/v3 v3.0.4 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect
golang.org/x/arch v0.18.0 // indirect
golang.org/x/mod v0.37.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sync v0.21.0 // indirect
golang.org/x/sys v0.46.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions internal/api/backup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (s *Server) listBackups(c *gin.Context) {
backups = filtered
}

c.JSON(http.StatusOK, gin.H{"backups": backups})
c.JSON(http.StatusOK, NewList(backups, "backups"))
}

func (s *Server) getBackup(c *gin.Context) {
Expand Down Expand Up @@ -140,7 +140,7 @@ func (s *Server) listDeploymentBackups(c *gin.Context) {
return
}

c.JSON(http.StatusOK, gin.H{"backups": backups})
c.JSON(http.StatusOK, NewList(backups, "backups"))
}

func (s *Server) deleteBackup(c *gin.Context) {
Expand Down
18 changes: 18 additions & 0 deletions internal/api/openapi.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package api

import (
_ "embed"
"net/http"

"github.com/gin-gonic/gin"
)

// Generated by tools/genspec and checked against the routes in CI. Serving it lets a client ask
// the instance it is talking to what that instance accepts.
//
//go:embed openapi.json
var openAPISpec []byte

func (s *Server) getOpenAPISpec(c *gin.Context) {
c.Data(http.StatusOK, "application/json; charset=utf-8", openAPISpec)
}
Loading
Loading